Skip to content

Bundler crashes when using npm to install dependencies #13125

Closed
@tmpace

Description

@tmpace

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions