I have installed a 64bit nodejs on my windows7 (classical installation, no errors during installation)
I created a simple package.json
{
"name":"chat",
"version":"0.0.1",
"private":"true",
"dependecies":{
"socket.io":"0.9.16",
"express":"3.1.0",
}
}
then install it with
npm install
and... Nothing: no packages are downloaded !
(if I make an error in the package.json, I got errors messages at npm install)
Everything seems to be fine, except that npm install does not install anything.
and of course when trying to luch a nodejs project, I got:
Error: Cannot find module 'express'
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)
You have a typo in your package.json, it should be "dependencies".
Make sure to generate your package.json with npm init, so to avoid this kind of problems.
Related
I have webpack-cli installed on my laravel project. I don't know why first of all we need it to run my vue app but this is causing an error:
When I run npm run dev or npm run hot
[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin-webpack5.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\index.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\Vue.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\ComponentRegistrar.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\Mix.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\setup\webpack.config.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\bin\cli.js
- C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack\bin\webpack.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:93:18)
at Object.<anonymous> (C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin-webpack5.js:6:42)
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\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\plugin-webpack5.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\plugin.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\vue-loader\\lib\\index.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\components\\Vue.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\components\\ComponentRegistrar.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\src\\Mix.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\laravel-mix\\setup\\webpack.config.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\lib\\bootstrap.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack-cli\\bin\\cli.js',
'C:\\Users\\Viruss\\Desktop\\test-meme-library\\meme-library\\node_modules\\webpack\\bin\\webpack.js'
]
}
Vue is installed also vue-loader, can't understand why it can't find those files. Also, I looked at the node_modules everything is in there ...
You need to update your vue-loader
npm update vue-loader
And if it is not installed, install it
npm i vue-loader
Laravel added the 15.9.7 version of Vue-loader by default. I have to manually update the vue-loader:^15.9.8 in the package JSON to solve the error.
Then do yarn and yarn dev or npm install and npm run dev
I had this error in my project. After searching for it, I discovered that I have to upgrade the Vue loader. And if not installed, go ahead and install it from here. So I add this line to my terminal in my project.
npm install -D vue-loader vue-template-compiler
running
npm update vue-loader
should do the work just fine if the vue-loader package is already installed.
Some of those updates are major releases. Running npm update won’t update the version of those. Major releases are never updated in this way because they (by definition) introduce breaking changes, and npm want to save you trouble.
Some times npm packages not gets installed properly, i used following method to resolve this problem:
**
Delete node modules folder from your project.
Execute following commands
npm install -g npm-check-updates
ncu -u
npm install/update.**
I have the entire set of sources of a site, based on KeystoneJS. I tried to deploy it to my laptop (without generator-keystone, because all required files are already generated), but even after
npm install
I got errors, like:
> node keystone.js
module.js:327
throw err;
^
Error: Cannot find module 'methods'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
I have installed methods, and now it requires utils-merge.
How I could install ALL required packages???
ENV: Ubuntu 14.04
npm install -g npm
The reason was in outdated NPM.
So we have a web application project. Let's call it MainProject. We have other modules that we made. Let's call it ChildProject. The ChildProject's package.json has devDependcies entries.
"devDependencies": {
"some-3rd-party-module": "^1.0.0"
}
So I run npm install in MainProject. However, some-3rd-party-module doesn't get installed because when I run npm start, it shows an error. The error looks like this
module.js:340
throw err;
^
Error: Cannot find module 'some-3rd-party-module'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
What are we doing wrong?
devDependencies are the dependencies needed only while developing the module, like testing frameworks. They won't be installed when you're including the module in another project.
If your module ChildProject depends on some-3rd-party-module that should be listed under its dependencies not devDependencies.
I'm using node v5.6.0 and bower 1.7.7 on a Mac.
I've done a npm install in my project folder which installs all the /node_modules including q.
I've also done a npm install -g q just to see if that helped.
But as soon as I run bower install (or just bower) anywhere I get
ambp:~ andreaslarsen$ bower
module.js:341
throw err;
^
Error: Cannot find module 'q'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/usr/local/bin/bower:6:9)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
Any suggestions?
I had this problem recently. I reinstalled bower globally. npm install and
"npm install -g bower" solved my problem. This downloaded the required folders in to node_modules directory globally and solved problem which I faced while installing packages with bower.
Turned out I just had to restart the terminal after doing the npm install and before doing the bower install
Works fine now
I also had this problem too, I tried a new terminal which didn't fix it, so I manually installed the missing module but it refused to find others, so upon further investigation it turned out to be a botched install of bower, which hadn't installed all its libs, so rerunning
npm install
fixed it for me.
I have Node.js and npm installed on Ubuntu 14.04.
nodejs -v
v0.10.25
node -v
v0.10.25
npm -v
1.3.10
I have also installed Gulp globally with npm install gulp -g.
gulp -v
CLI version 3.9.0
Now in my project when I try to install Gulp locally with npm install gulp I get a lot of errors. I have copied them to Pastebin: http://pastebin.com/VWdPLNQS
If I try to run gulp watch in my project directory, I get
Local gulp not found in /var/www
Try running: npm install gulp
What do I need to do?
I tried this on Windows too. The Ubuntu installation is running with Vagrant. I have it installed so that it shares the /var/www directory with the host machine.
First I downloaded Node.js from their website and after that I ran
npm install -g bower
npm install -g gulp
No errors. Then I opened command prompt in Windows and changed directory to the folder where /var/www is linked. I ran npm install. My package.json contains the following
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "^2.0.0"
}
}
No errors. I tried running gulp in the Ubuntu terminal after this installation but I got errors:
Error: Cannot find module 'isobject'
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.<anonymous> (/var/www/node_modules/laravel-elixir/node_modules/watchify/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/braces/node_modules/expand-range/node_modules/fill-range/index.js:10:16)
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)
at Module.require (module.js:364:17)
I switched to Windows and run gulp, everything worked.
Try to install never version of Node.js and NPM:
Remove node_modules, then remove gulp globally and locally.
After that make sure you are on newer nodejs, like 6+
Install gulp globally
Check permissions on folder you are trying to use, run chown [your_user_name] [folder_name] -R
I think updating node/npm update should resolve your problem.