I have installed selenium-webdriver globally using nmp install -g.
I have also made sure that path to the global node_modules is present in the NODE_PATH environment variable.
However when I try to execute a simple .js script, node fails to find the nodule.
I feel I'm missing something rather simple here, but can't figure out what.
ip-192-168-4-31:end2endtests xxxxx$ npm ls -g|grep "selenium.*"
└─┬ selenium-webdriver#4.0.0-alpha.1
ip-192-168-4-31:end2endtests xxxxx$ echo $NODE_PATH
/usr/local/lib/node_modules
ip-192-168-4-31:end2endtests xxxxx$ node tests.js
module.js:557
throw err;
^
Error: Cannot find module 'selenium-webdriver'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/xxxxx/Documents/end2endtests/helpers.js:1:79)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
Related
I am going to uglify index.js file. But it throws this error: Cannot find module 'optimist'.
I have installed optimist: npm install optimist but it doesn't work. Anyone can help?
uglifyjs index.js
module.js:550
throw err;
^
Error: Cannot find module 'optimist'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/nodejs/uglify-js/bin/uglifyjs:8:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
try this command,
npm i optimist --save
If It does not work then try this,
Delete node_modules folder & package-lock.json
&then try this command,
npm i --save
I'm adding 1 new library to my project (express-fileupload), but, when run node server this return that message, I tried with the commands:
npm install
npm loader
npm install winston (this for a problem reported in a Github project)
npm start
but this dont work.
$ node server.js
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module '/lib/index'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\david\Documents\INTRANET\dusoft-server\server.js:15:18)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
I am starts working on expressJs nodeJs but stuck at a beginning point to run the node server.js command. I think any module is missing to install but i`m not recognize which one is missing.Im working on linux(ubuntu) operating system. Please help me to out this problem.
iron#iron-System-Product-Name:/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-panel/node-admin-master$ node server.js
module.js:442
throw err;
^
Error: Cannot find module '/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-panel/node-admin-master/config/env/undefined'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-panel/node-admin-master/config/routes.js:6:14)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-panel/node-admin-master/server.js:14:13)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
Node Version: v6.2.2
Npm version: 3.9.5
it take undefined of variable which may you declare in config/env/undefined.
Please check your env file or if possible share with me .
Thanks
With the error, i suspect you are missing iron-node module.
To simply install in project, run
npm i iron-node
to install and save it in the project's package.json, run:
npm i iron-node --save
to install it in your computer, do:
npm i -g iron-node
However, since this is a development dependency, you should install it as one and save it in package.json, by:
npm i iron-node -D --save
I am getting the following error upon runing bower install.
$ bower install
module.js:340
throw err;
^
Error: Cannot find module 'minimist'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v5.1.0/lib/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js:2:16)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
I have "minimist" installed as a local npm package but not globally. Is there any way to get bower to recognize the local package and avoid installing minimist globally?
Running npm install -S minimist in a CLI from your project root directory should solve your problem.
I have updated my node to latest one.
I have also tried uninstalled and reinstalled the node one time to fix this problem but no success.
I have also run the command sudo npm install -g to-fast-properties to install this module.
Can anyone help why this error is still coming?
browserify -t babelify app.js -o bundle.js
module.js:338
throw err;
^
Error: Cannot find module 'to-fast-properties'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/saurabhchaudhary/www/react-soundplayer/examples/node_modules/babelify/node_modules/babel-core/lib/types/index.js:23:25)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
By the I am using react library which I would like to browserify my js code to execute in browser. Is there any other way to do same?