Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundler crashes when using npm to install dependencies #13125

Closed
tmpace opened this issue Mar 24, 2017 · 3 comments
Closed

Bundler crashes when using npm to install dependencies #13125

tmpace opened this issue Mar 24, 2017 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@tmpace
Copy link

tmpace commented Mar 24, 2017

Description

With an app running in the emulator, when running the command npm install --save lodash I get this output:

Bundler:

 ERROR  EPERM: operation not permitted, lstat 'C:\Users\Trevor\Code\Learn\test\node_modules\.staging\lodash-f4bb885f\fp'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"C:\\Users\\Trevor\\Code\\Learn\\test\\node_modules\\.staging\\lodash-f4bb885f\\fp"}
Error: EPERM: operation not permitted, lstat 'C:\Users\Trevor\Code\Learn\test\node_modules\.staging\lodash-f4bb885f\fp'

Npm error:

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Trevor\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "lodash"
npm ERR! node v7.6.0
npm ERR! npm  v3.8.0
npm ERR! path C:\Users\Trevor\Code\Learn\test\node_modules\lodash
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error
npm ERR!     at moveAway (C:\Users\Trevor\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR!     at destStatted (C:\Users\Trevor\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:114:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Trevor\Code\Learn\test\node_modules\lodash' -> 'C:\Users\Trevor\Code\Learn\test\node_modules\.lodash.DELETE'
npm ERR!  { Error
npm ERR!     at moveAway (C:\Users\Trevor\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR!     at destStatted (C:\Users\Trevor\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:114:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Trevor\Code\Learn\test\node_modules\lodash' -> 'C:\Users\Trevor\Code\Learn\test\node_modules\.lodash.DELETE' parent: 'test' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Trevor\Code\Learn\test\npm-debug.log

Note: I was running as admin, and my environment variables are set properly, and I do not get errors when using npm install when the bundler is not watching my files.

Reproduction Steps and Sample Code

I'm honestly not sure - you can try to npm install a dependency while the bundler is running, but I haven't been able to find anything regarding this issue online :\

Solution

No idea - seems to be some sort of permissions issues, I don't know if the bundler modifies the permissions of files it's watching, but I am running as an admin. Ideally I wouldn't have to shut the application down each time I needed to install an outside dependency.

Additional Information

  • React Native version:
    react-native-cli: 2.0.1
    react-native: 0.42.3

  • Platform: Android

  • Development Operating System: Windows 10

  • Dev tools:
    Android Studio version: 2.3
    Android SDK version: 23

Would really appreciate a fix! I love developing in React, but honestly, I may have to just roll native Android development if I can't get this environment issue figured out.

@tmpace
Copy link
Author

tmpace commented Mar 24, 2017

I should note that I have tried switching back to node 6.1.0 to test and that didn't make a difference.

I have also tried a fresh install of Android Studio, as well as Node - no dice.

@tmpace
Copy link
Author

tmpace commented Mar 31, 2017

It seems I've fixed this by using watchman - However, this is not apparent anywhere on the official documentation (https://facebook.github.io/react-native/docs/getting-started.html).

Finding a windows version of watchman could also be easier.

@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Jul 25, 2017
@hramos hramos closed this as completed Jul 25, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 25, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants