I am walking through basic set up of an AngularJS application (Just getting started) and am currently trying to install Bower components for the application.
When I run bower install
from the terminal, I get the following error:
Error: Cannot find module 'js-yaml'
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> (Path\bower\node_modules\configstore\index.js:9:12)
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)
at require (module.js:385:17)
I haven’t specified js-yaml
module anywhere in my scripts (as far as I am aware), so not sure where this dependency is coming from.
I have tried deleting the node_modules folder, clearing the npm cache, including js-yaml
within the package.json
file then re-running npm install, but I get the same error when running bower install
If it helps, my bower.json
and package.json
files are shown below:
Bower.json
{
"name": "starter-node-angular",
"version": "1.0.0",
"dependencies": {
"bootstrap": "latest",
"font-awesome": "latest",
"animate.css": "latest",
"angular": "latest",
"angular-route": "latest"
}
}
package.json
{
"name": "starter-node-angular",
"main": "server.js",
"dependencies": {
"express" : "~4.5.1",
"mongoose" : "~3.8.0",
"body-parser" : "~1.4.2",
"method-override" : "~2.0.2",
"js-yaml" : "latest"
}
}
I am using WebStorm 10.0.4 (empty project as the starting point).
Has anyone come across this or a similar issue and possible point me in the right direction on how to resolve the issue?
package.json
file to look like this and then donpm install
. When that finish, then dobower install
– Enatelatest
to get the latest version of a package, the*
is used for that. Doing so might install the package hence solving your problem. – Enate