How to run the NPM RUN BUILD

Viewed 605

I have for now 7 days tried to build my ReactJs project but it never works.

quick update, I can do npm run build like every 50-100th time i run it, I just have to be keep running the command and waiting for it to succeed .

When I do NPM RUN BUILD in vscode I always get the error

(copy plugin) Error: EBUSY: resource busy or locked, copyfile 'L:\react\Greta100Weeks\greta100weeks\notistack\src\index.d.ts' -> 'L:\react\Greta100Weeks\greta100weeks\notistack\dist\index.d.ts'

I tested to build on different locations to rule out that the folder or file was locked. I turn of MacAfee LiveSafe background scanning virus. I don't have any Drive syncing locking folders

I use the Windows 10 Resource Monitor to see if the notistack folder and the files are locked by some process and they are not, it's super strange. I have no backup process on that folder, Mcafee LiveSafe is turned of also

I notice that npm run build works like every 20-30 times i run the command . When I restart computer it worked one time also. It's like something is polling locking the files randomly

Another thing I can see is that the error say that the file "index.d.ts" can't be copied. I then open the notistack\dist\ folder and see a "index.d.ts" file and when I open the file in notepad++ I see this: just a bunch of NULNULNULL..........

enter image description here enter image description here Here I try running npm run build on a fresh fork of the notistack in the cmd window

enter image description here

1 Answers

I did what you did. Cloned repo of Notistack. did npm i and then npm run build. it worked for me.

From your screenshot, i tried to match it with mine. i found that probably you haven't installed node modules at proper place. when you clone the repo. it already creates a notistack folder on top of where it is located on your computer.

The differnce i found is, both your paths should partially match till notistack folder. In your ss, JSON is written at perfect place, but typescript path is different from mine.

so from your screenshot, i think you should try doing npm i at

L:\react\Greta100Weeks\greta100weeks\notistack

I hope it makes sense !

Related