3

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

Kid
  • 1,869
  • 3
  • 19
  • 48
  • is this the solution to your question ? https://stackoverflow.com/questions/55081270/getting-error-ebusy-resource-busy-or-locked – Nidhi Dadiya Sep 17 '21 at 18:16
  • @NidhiDadiya did not work. 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 – Kid Sep 18 '21 at 12:39
  • why did you use .d.ts for your index file? – DevAddict Sep 18 '21 at 12:46
  • @DevAddict I just fork [Notistack](https://github.com/iamhosseindhv/notistack) and download it with GitHub Desktop and do the npm run build. I dunno about the file names do you think something is wrong? – Kid Sep 18 '21 at 12:49
  • 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 – Kid Sep 18 '21 at 12:53
  • 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 .Windows 10 is so fucked up LOL – Kid Sep 18 '21 at 15:45
  • Your latest ss says you need to update `npm` by `npm update` – Nidhi Dadiya Sep 19 '21 at 17:57

1 Answers1

1

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 !

Nidhi Dadiya
  • 798
  • 12
  • 31
  • Thanks, here a [screenshot](https://snipboard.io/9L2WmO.jpg) showing I do run the command in "L:\react\Greta100Weeks\greta100weeks\notistack " – Kid Sep 18 '21 at 16:11
  • I dont understand what you mean by "haven't installed node modules at proper place." – Kid Sep 18 '21 at 16:13
  • 1
    I hope when trying again with `npm run build` you're removing the typedoc.json file. and also I see there are some node modules in the parent folder too. can you try putting notistack folder at some other location? – Nidhi Dadiya Sep 18 '21 at 16:17
  • When I originally cloned from GitHub the Notistack was saved [here](https://snipboard.io/ft5G3L.jpg) . Then I copy the folder into the "L:\react\Greta100Weeks" just for testing, maybe it would work better if the notistack was under the same node_modules folder as the app , dunno just testing – Kid Sep 18 '21 at 16:19
  • 1
    Good. So go there in vs code(git/notistack/) and do `npm run build` is it working there? – Nidhi Dadiya Sep 18 '21 at 16:21
  • 1
    if you want notistack to be there at greta100weeks. try cloning there. or else copy folder there, remove node modules and do `npm i` again. – Nidhi Dadiya Sep 18 '21 at 16:24
  • 1
    ok thanks, I do "npm link" on notistack so it can be located anywhere i guess. ok now running npm run build from the git folder...But I have [problem with nmp link to](https://stackoverflow.com/questions/69136755/cant-set-breakpoints-on-npm-linked-library). Usually I dont have this much problem really heheh – Kid Sep 18 '21 at 16:30
  • ok it failed again from the git folder, here's a [screenshot](https://snipboard.io/LPxIlo.jpg). so frustation I was thinking to reinstall laptop really – Kid Sep 18 '21 at 16:33
  • Running npm run build again error [hmm](https://snipboard.io/R0wJBY.jpg) – Kid Sep 18 '21 at 16:38
  • I will as you suggest @Nidhi Dadiya - remove node modules and do npm i again – Kid Sep 18 '21 at 16:41
  • 1
    do `npm i` too if you're removing node modules – Nidhi Dadiya Sep 18 '21 at 16:47
  • ok after delete node_modules and doing nmp i and then again running npm run build, i get the same error ..Error: EBUSY: resource busy or locked, copyfile 'L:\git\notist..... ok now laptop go out the window LOL – Kid Sep 18 '21 at 17:10
  • will start laptop in windows safe mode now and try running the "npm run build" – Kid Sep 18 '21 at 17:14
  • Result after starting laptop in Windows Safe Mode and running npm run build is that it failed at first attempt and it success on second attempt here is a [screenshot](https://snipboard.io/BbNrvK.jpg). One should be happy with that NOOOOT, WTF is going on. This was on on the L:/git/notistack but on the other copied L:\react\Greta100Weeks\greta100weeks\notistack it failed. I have no clue where to go from here...My Facebook please be kind https://www.facebook.com/profile.php?id=100016526263449 – Kid Sep 18 '21 at 17:52
  • 1
    I did a bug report at [npm](https://github.com/npm/cli/issues/3774) – Kid Sep 18 '21 at 18:16