简体   繁体   中英

Getting error while installing udev module in node js

I'm runnig command :

npm install udev

And I'm getting this error:

 npm WARN enoent ENOENT: no such file or directory, open '/home/mitesh/package.json' npm WARN mitesh No description npm WARN mitesh No repository field. npm WARN mitesh No README data npm WARN mitesh No license field. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! udev@0.6.0 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the udev@0.6.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/mitesh/.npm/_logs/2020-03-16T11_44_35_032Z-debug.log

Looks like you do not have a package.json in your project or it is probably not rightly placed. Here is what you can do;

Browse to your project directory and run this command;

npm init

This should create a package.json file in your project directory

Then run,

npm install udev --save

--save will ensure your module is saved as a dependency in your package.json file.

you could just try to run the last command without the --save but in some cases it helps

Here is a link to further assist: npm WARN enoent ENOENT: no such file or directory, open 'C:\\Users\\Nuwanst\\package.json'

Try this let me know if it helps.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM