"ng --version" module.js:471 throw err - node.js

I am trying to recreate the environment for an existing project combining dotnet core and angular, based on the original versions.
I'm using the free Windows 10 development environment VM for VirtualBox.
Successfully installed dotnet core sdk 2.0.0, successfully installed node 6.11.4 (with npm 3.10.10).
To install angular cli I used: npm install -g #angular/cli#1.6.4
When trying ng --version, I get the following error, please advise...
>ng --version
module.js:471
throw err;
^
Error: Cannot find module '#angular-devkit/core'
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:\Users\User\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\schematics\src\tree\virtual.js:10:16)
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)

1. run npm update -g #angular/cli
2. edit package.json changing the line "#angular/cli": "1.6.0",
to
"#angular/cli": "^1.6.0"
3. run npm update will work for this error.
Or else try running
npm i -D #angular-devkit/core

Related

Express not working with node 9.x

I have an Ubuntu box with node - v 9.5.0 and npm - 5.6.0 versions. I am trying to use expressjs (http://expressjs.com), but unable to run it. It works fine for node v 4.x.x.
$ express -h
module.js:557
throw err;
^
Error: Cannot find module 'commander'
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> (/usr/lib/nodejs/express-generator/bin/express:3:15)
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)
What is it that I am missing here?
Ubuntu's packages seem to be outdated.
Installing using apt-get node-express-generator gives this error.
Installing using npm i -g express-generator works fine.
Please try to follow the preceding steps.
Install the current version of NodeJS
Uninstall all modules with npm uninstall and rm -fr ~/.npm
Reinstall express-generator
Hope it helps.

Cannot find module 'ansi-regex' | npm not getting uninstalled or updated

I am unable to uninstall or update npm. I tried running rn -rf node-modules, rimraf node-modules, and even manually deleting the npm folder from the system. I even removed the environment variable. Unfortunately, nothing is working.
I uninstalled nodejs and completely removed ALL the folders and temp files. Post system restart, I did a fresh installation of nodejs and when I again tried to install npm, I get this error:
throw err;
^
Error: Cannot find module 'ansi-regex'
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:\Users\Admin\AppData\Roaming\npm\node_modules\npm\n
ode_modules\strip-ansi\index.js:2:38)
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)
Basically, whatever method I tried, I get the same error. Please help!
node version: v6.11.0
OS: Windows 8
I have also tried installing 'ansi-regex' using npm install ansi-regex

`ember install emberfire` failed, is ember-cli-emberfire a better route with Node 6.2.2?

Cannot find module 'q' and more…
When I run ember install emberfire in an existing Ember app, I get Cannot find module 'q'.
I searched the issue, tried npm cache clean and npm install q.
Now, ember install emberfire throws Cannot find module '../function/makeIterator_' and I'm reluctant to go further.
However, at npm-embercli-emberfire the advice is to install via Bower with npm install --save-dev ember-cli-emberfire - to quote:
This repo lists emberFire as a bower dependency
It runs bower install as the npm postinstall script
it exports a tree containing both the firebase and emberFire libraries
Do node 6.2.2 and ember-cli play nicely yet?
Since the machinations of npm and Node become an irritating mystery when I'm trying to focus on an Ember (tutorial) app, I'd like to know:
how running ember install emberfire differs, and if running it before running the npm-recommended command is an issue?
If it's okay to run ember-cli with node 6.2.2 - if not, suggestions?
My setup
OS X 10.11.6 (and just had to chown -R usr/local after an OS X update).
node 6.2.2 (which apparently "has currently not been tested against Ember CLI and may result in unexpected behaviour.")
Ember: 1.13.15
ember-cli: 1.13.15
ember-data: 2.7.0
node: 6.2.2
npm: 2.14.10
emberfire: 2.0.1
ember-cli-emberfire: 0.0.1
The full error readout:
$ ember install emberfire
version: 1.13.15
Installed packages for tooling via npm.
installing emberfire
identical app/adapters/application.js
Cannot find module 'q'
Error: Cannot find module 'q'
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/admin/projects/solutions-log/node_modules/ember-cli/node_modules/bower/lib/commands/index.js:1:71)
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)
$ npm cache clean
$ npm install q
solutions-log#0.0.0 /Users/admin/projects/solutions-log
└── q#1.4.1
$ ember install emberfire
version: 1.13.15
Installed packages for tooling via npm.
installing emberfire
identical app/adapters/application.js
Cannot find module '../function/makeIterator_'
Error: Cannot find module '../function/makeIterator_'
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/admin/projects/solutions-log/node_modules/ember-cli/node_modules/bower/lib/node_modules/mout/array/collect.js:2:20)
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)

Gulp error, cannot find module 'vinyl'

I have been struggling with getting flux/react to work properly and thought that my npm, node or gulp versions were to old.
So I updated everything to the latest version and now I get the following error when i run gulp in ALL my projects:
module.js:340
throw err;
^
Error: Cannot find module 'vinyl'
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> (/usr/local/lib/node_modules/gulp/node_modules/gulp-util/index.js:2:9)
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)
I have:
Uninstalled node and gulp through npm.
Uninstalled npm.
Installed node and npm via https://nodejs.org/en/
Installed gulp through npm
And it's still not working..
Anyone have any ideas?
As #keithRousseau pointed out, when I reinstalled the packages I forgot to install them with the parameter -g to install them as global packages.
Reinstalled them with -g and now it works!

Meteor bundle error on startup

I have an issue with meteor bundle. I try to start bundle with foreverjs but get error
root#ip-172-31-0-83:/home/ubuntu/bundle# cat ../logs/forever.log
module.js:340
throw err;
^
Error: Cannot find module 'fibers'
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> (/home/ubuntu/bundle/programs/server/boot.js:1:75)
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)
error: Forever detected script exited with code: 8
I tried install fibers via npm
npm install fibers -g
,also I've tried install in local meteor node_modules dir.
But unfortunately error stays.
Version of meteor is 0.9.1.1
The procedure to install Fibers has changed in 0.9.x+
From the docs:
cd bundle
cd programs/server
npm install
Also, the correct setup instructions (for a bundle built by any version of Meteor) can be found in the bundle's README file.

Resources