npm does not install into node_modules -
i in directory containing node_modules
directory
ls > coverage etc gruntfile.js lib node_modules npm-debug.log package.json
from directory, npm install
spits out following:
npm err! error: attempt unlock grunt-contrib-jshint@0.10.0, hasn't been locked npm err! @ unlock (/usr/local/lib/node_modules/npm/lib/cache.js:1434:11) npm err! @ cb (/usr/local/lib/node_modules/npm/lib/cache.js:675:5) npm err! @ /usr/local/lib/node_modules/npm/lib/cache.js:684:20 npm err! @ /usr/local/lib/node_modules/npm/lib/cache.js:1420:7 npm err! @ /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38 npm err! @ openreq.req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5) npm err! @ openreq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22) npm err! @ object.oncomplete (fs.js:107:15) npm err! if need help, may report *entire* log, npm err! including npm , node versions, at: npm err! <http://github.com/npm/npm/issues>
i tried npm config set prefix /my/path/ --global
, /my/path/ contains node_modules directory. tried using -g --prefix=/my/path. there's no way change install directory, apparently design. apparently 1 , way npm install working, design, not work.
edit: here's hacky workaround had use in meantime. not ideal if system has 1 project, it's fine.
sudo npm install sudo cp /usr/local/lib/node_modules /my/path/ -r
unless there more aren't including, symptoms here don't have global install location.
the error in first line of output npm install
indicates problem trying solve:
npm err! error: attempt unlock grunt-contrib-jshint@0.10.0, hasn't been locked
this suggests solution same in this other stackoverflow question , permissions based. quick search error text results in many similar solutions related permissions.
check directory permissions sure ownership appropriate. if is, try sudo npm install
best answer resolve directory permissions rather rely upon sudo
.
Comments
Post a Comment