"ENOENT: no such file or directory, rename ..." when running npm install
After running npm install --save-dev sqlite3, each subsequent time I try to run npm install I get an error relating to "ENOENT: no such file or directory, rename ...".
The first subsequent run resulted in the following:
npm ERR! path /Users/[...]/node_modules/.staging/npmlog-702088a9
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/[...]/node_modules/.staging/npmlog-702088a9' -> '/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog'
npm ERR! enoent This is related to npm not being able to find a file.
The next run resulted in this error:
npm ERR! path
/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/[..]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
Environment: MacOS 10.12.6 NPM 5.3.0 Node v6.11.2 Also occurring on Jenkins on Ubuntu 16.04 LTS.
us npm ci to clean and install all packages. and then install the package you want. it works for me this way