I'm on a windows machine however my node is set to Darwin. Is there a command to switch ?
It's stopping me from adding a windows service and is erroring with:
Error: Cannot find module 'os-service'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Fusiozii\REST-API\rest.js:25:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Node = v6.11.2
Node-gyp = v3.4.0
I upgraded to angular 5 and noticed that my build keeps failing on VSTS (locally it works fine)
It looks like a dep from angular-cli cannot be found. Any solutions?
Build Output
[command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run build -- "--env=nightlybuild""
2018-01-29T19:06:23.9805943Z
2018-01-29T19:06:23.9807508Z > aes-web-portal#0.0.0 build d:\a\1\s\AESWebPortal\aes-web-portal
2018-01-29T19:06:23.9808541Z > ng build "--env=nightlybuild"
2018-01-29T19:06:23.9809016Z
2018-01-29T19:06:26.8023599Z Cannot find module 'uglifyjs-webpack-plugin'
2018-01-29T19:06:26.8041057Z Error: Cannot find module 'uglifyjs-webpack-plugin'
2018-01-29T19:06:26.8041907Z at Function.Module._resolveFilename (module.js:469:15)
2018-01-29T19:06:26.8042680Z at Function.Module._load (module.js:417:25)
2018-01-29T19:06:26.8043360Z at Module.require (module.js:497:17)
2018-01-29T19:06:26.8044136Z at require (internal/module.js:20:19)
2018-01-29T19:06:26.8046229Z at Object.<anonymous> (d:\a\1\s\AESWebPortal\aes-web-portal\node_modules\#angular\cli\models\webpack-configs\production.js:13:24)
2018-01-29T19:06:26.8047263Z at Module._compile (module.js:570:32)
2018-01-29T19:06:26.8048144Z at Object.Module._extensions..js (module.js:579:10)
2018-01-29T19:06:26.8048743Z at Module.load (module.js:487:32)
2018-01-29T19:06:26.8049274Z at tryModuleLoad (module.js:446:12)
2018-01-29T19:06:26.8049758Z at Function.Module._load (module.js:438:3)
2018-01-29T19:06:26.8050286Z at Module.require (module.js:497:17)
2018-01-29T19:06:26.8050774Z at require (internal/module.js:20:19)
2018-01-29T19:06:26.8051383Z at Object.<anonymous> (d:\a\1\s\AESWebPortal\aes-web-portal\node_modules\#angular\cli\models\webpack-configs\index.js:9:10)
2018-01-29T19:06:26.8052009Z at Module._compile (module.js:570:32)
2018-01-29T19:06:26.8052499Z at Object.Module._extensions..js (module.js:579:10)
2018-01-29T19:06:26.8052975Z at Module.load (module.js:487:32)
I just transfered my Angular 5 project from one computer to another and in the new device I get the following error when trying to ng serve:
Cannot find module 'tapable'
Error: Cannot find module 'tapable'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (c:\xampp\node_modules\webpack\lib\Template.js:7:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (c:\xampp\node_modules\webpack\lib\node\NodeMainTemplatePlugin.js:5:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
I tried to:
Remove node_modules and run again npm install.
npm install tapable
My node version is 6.11.2 with npm 5.3.
Any idea what can solve it?
Fix: I had to manually npm install webpack in order to solve this issue.
I am having the error
$ node node_modules/.bin/ngc --project foo
module.js:471
throw err;
^
Error: Cannot find module './codegen'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/paul/lucid/main2/cake/node_modules/.bin/ngc:5:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
I'm trying to decrypt this error. What is ./codegen and what path is node trying to read it from?
After I upgraded NodeJS and NPM to 6.2.0 and 3.9.3, when I run hexo d -g command to update my blog, I get the following error:
Error: Module version mismatch. Expected 48, got 46.
at Error (native)
at Object.Module._extensions..node (module.js:568:18)
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
{ Error: Cannot find module './build/default/DTraceProviderBindings'
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
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> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32) code: 'MODULE_NOT_FOUND' }
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.
I thought maybe Node.js is upgraded and node_modules should be reinstalled.
I tried rm -rf node_modules && npm install, but it doesn't work. I also tried sudo npm i -g npm then npm install hexo --no-optional --save, which doesn't work neither.
Any advice would be most appreciated.
Actually, after upgrading node, your installed packages kept compiled against the older version, and they need to be rebuilt. No need to delete node_modules, or running npm update.
Just run:
npm rebuild
Hexo doesn't seem to work with lastest version of node which is 6.2.0. You should use node-v4.4.5 (LTS) for a while, which is recommended version for most users.
It looks like hexo is a globally installed package, but you only reinstalled it locally. Try to reinstall it globally:
npm install hexo -g
Maybe your Global installation files has not been update, please try to update your hexo-cli with command below:
sudo npm install -g hexo-cli
which solved my problem.