I'm getting the following error in my angular2 app with cmd ng serve after deleting the node_modules directory and building it new with npm install.
Error: Cannot find module 'common-tags'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/models/config.js:8:21)
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:311:12)
at Module.require (module.js:366:17)
also npm install common-tags to add it manually does not work
Looks like you should update your angular-cli and clean the cache
npm uninstall -g #angular/cli
npm cache clean --force
npm install -g #angular/cli#latest
npm install
Related
I am trying to connect to Bigcommerce Stencil. I am able to pull and download but having trouble with pushing as I kept getting a no webpack module error. I have tried several things like google for hours but no lack.
rm -rf node_modules
rm -f package-lock.json
npm install
npm install --save-dev webpack
npm install --save-dev webpack-dev-server
npm install --legacy-peer-deps
npm install --save --legacy-peer-deps
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'webpack'
Require stack:
- C:\Users\z\downloads\bigcommerce\skeyndor\stencil.conf.js
- C:\Users\z\AppData\Roaming\npm\node_modules\#bigcommerce\stencil-cli\lib\BuildConfigManager.js
- C:\Users\z\AppData\Roaming\npm\node_modules\#bigcommerce\stencil-cli\lib\stencil-start.js
- C:\Users\z\AppData\Roaming\npm\node_modules\#bigcommerce\stencil-cli\bin\stencil-start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (C:\Users\z\downloads\bigcommerce\skeyndor\stencil.conf.js:1:15)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\z\\downloads\\bigcommerce\\skeyndor\\stencil.conf.js',
'C:\\Users\\z\\AppData\\Roaming\\npm\\node_modules\\#bigcommerce\\stencil-cli\\lib\\BuildConfigManager.js',
'C:\\Users\\z\\AppData\\Roaming\\npm\\node_modules\\#bigcommerce\\stencil-cli\\lib\\stencil-start.js',
'C:\\Users\\z\\AppData\\Roaming\\npm\\node_modules\\#bigcommerce\\stencil-cli\\bin\\stencil-start.js'
]
}
npm i --save webpack
Try installing webpack or add it to package.json
I just installed nodejs x64 on my Windows 10 computer. I keep all default config,
I open cmd and type:
npm -v
Then i got following error:
module.js:457
throw err;
^
Error: Cannot find module 'umask'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\W10-PRO\AppData\Roaming\npm\node_module\npm\lib\utils\umask.js:1:75)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
Every command start with "npm" create this error and npm cannot uninstall, update itself)
Please help me fix this error?
update your npm
$ npm install npm -g
I would try to update/install NPM
$ npm update -g npm
I know the answer!
Uninstall nodejs.
Delete all references to npm and nodejs (Program Files, Program Files(x86).
Then also delete those in AppData/Roaming (npm and npm-cache to be sure).
Reinstall nodejs.
It works!
Can somebody help me? I'm new in ionic. When I try to run serve, this error appears. I ran sudo npm install -g cordova, but the error came back.
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Try removing them and reinstalling
npm cache clean
npm uninstall -g cordova ionic
npm install -g cordova ionic
Use sudo if you are on a mac or a linux.
are you sure you're in the project directory? As in assuming you created your app on the desktop, are you sure you're not in C://Users/username/Desktop instead of C://Users/username/Desktop/myApp ?
I've just installed a fresh copy of Ubuntu 15.10, node 4.2.2 and npm 2.14.7 (with nvm) on a new machine. I have installed webpack and webpack-dev-server globally and installed my project dependencies with npm i.
Now when I try to run my node server I get the following errors:
module.js:339
throw err;
^
Error: Cannot find module 'errno'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:7:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
Any suggestions please?
Node.js searches for modules in the ./node_modules/ directory in the path where the program is.
For example if you script is here /home/user/scripts/somescript.js you should have /home/user/scripts/node_modules/.
Just do npm install errno in here /home/user/scripts/.
It seems that something had gone wrong with my npm install and my project dependencies were only partly installed. Just running npm install again didn't fix it. I did an npm cache clean, removed my node_modules directory and then ran npm install again. The problem was then resolved.
I cant seem to ran any commands against > npm including > npm help ,> npm uninstall or > npm upgrade
the full error is
module.js:339
throw err;
^
Error: Cannot find module 'lodash._basetostring'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npmlog\node_modules\gauge\node_modules\lodash.pad\index.js:9:20)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
I cant run > npm install lodash._basetostring or npm anything
Tried reinstalling and running 'npm cache clean' but even that didn't work, so here's my solution:
Delete all files from, you may want to backup the files first but those are corrupted anyway.
<user profile directory>\AppData\Roaming\npm\node_modules
and then try running npm command, if this works then there's no need to reinstall, just install npm modules using
npm install -g <package names>
Otherwise uninstall node.js, empty above stated folder and then install node.js.
Don't forget to update npm
npm install npm#latest -g