I am trying to run npm install
in my Linux centos machine as jenkins
but it is failing with:
npm WARN tar ENOENT: no such file or directory, lstat '/home/jenkins/workspace/'job name'/Scheduler/scheduler-component/node_modules/ "
But if I run npm install
as root
this works fine.
Why does this happen and how can I resolve it?
The problem related to the $PATH and Global / Local, npm expect it to be there and its not, run as root using the root $PATH so files exists, the npm
It means that when doing something like fs.lstat('/home/ubuntu/.npm/iconv-lite/0.2.11/package/encodings/table/gbk.js', ...), npm received ENOENT error. Which means the file was missing, but npm expected it to be there.
if not try to :
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.