Throw error whenever attempting to use geoproject command in terminal - node.js

I keep getting the same error anytime I try to use the geoproject command.
I have the latest version of node and D3 downloaded.
error message:
Parkers-MacBook-Pro-2:proj parkerbarton$ geoproject
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'resolve'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/d3-geo-projection/bin/resolve.js:2:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

tldr; Just re-install to get the new version of d3-geo-projection.
npm install -g d3-geo-projection
There's an issue for this here: https://github.com/d3/d3-geo-projection/issues/161
And there's a fix for this up on a pull request, but it hasn't gotten pulled in yet. You could wait for the fix or in the meantime you can probably just add 'require' into the same place in {global-install-location}/node_modules/d3-geo-projection/package.json
https://github.com/d3/d3-geo-projection/pull/162/commits/43105df62b784f0645cb3d4cb0b0fa98c8924c87
UPDATE: It's up on 2.6, just re-install d3-geo-projection.

Related

node js express not able to resolve node modules/merge-descriptors

I have a simple node.js express application.
When I run npm run serve, I am getting below error.
In my node_modules folders I can see merge-descriptors folder, but when I try to start express server, looks like it is complaining about not able to find the component.
My path correctly has node_modules/.bin set.
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'merge-descriptors'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/tmp/site/node_modules/express/lib/express.js:16:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

cannot find module './framer' after deleting node modules

I was cleaning up the angular code and, deleted some unused custom modules. After which, It was throwing an error about a deleted imported component in app.module.ts even though it was already removed from import.
Then, I manually deleted the node modules, ran npm install and tried to run npm start which gives me the following error:
Cannot find module './framer'
Error: Cannot find module './framer'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\NBS627\eclipse-workspace\ccmobile-
UI\node_modules\spdy-transport\lib\spdy-transport\protocol\base\index.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\NBS627\eclipse-workspace\ccmobile-
UI\node_modules\spdy-transport\lib\spdy-transport.js:10:27)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
I have no idea about this error. Please help.
Your error says that you have a problem with your spdy-transport module.
To solve this you must update your spdy-transport module:
npm un spdy-transport
Then:
npm i spdy-transport
One of the packages which you deleted might have a dependency on an existing module
for example, when we do npm install package-name, often more than one folder are created in the node_modules folder, we may think that it is not required but it is in fact needed

What is module.js 540 throw error?

Just installing node/npm first time, Linux Fedora: I've followed all the instructions and tried every fix I can find on google.
Whenever I try to run npm install or npm test I get this:
module.js:540
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at /usr/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
It was a bug and it has already been fixed in Node v5.4.1. Now it's working as usual.

My npm command does not work "Cannot find module 'internal/errors'"

My npm command does not work anymore I uninstall and re install nodejs many times and still getting the same issue, so here is my console output, how can I fix this?
C:\Users\pirat>npm install
module.js:529
throw err;
^
Error: Cannot find module 'internal/errors'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at evalmachine.<anonymous>:36:16
at Object.<anonymous> (C:\Users\pirat\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
C:\Users\pirat>
I re-install node version 6.11 and updated npm now is all working :)

Error: Cannot find module './is-buffer'

I haven't found any posts that have an answer for this one. It appears to be a sourcing issue, but no matter what I try I can't seem to source it properly. I get the following error when trying to launch my application.
is-buffer is installed. I see it in my node-modules directory.
C:\MY-APP\dataService>node dataAPI.js
module.js:338
throw err;
^
Error: Cannot find module './is-buffer'
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> (C:\MY-APP\node_modules\socket.io\node_modules\so
ket.io-adapter\node_modules\socket.io-parser\index.js:11:13)
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)
I tried setting this in my binary file as well as my package.json. I'm able to change it in my binary file, but no matter what I'm not able to find the correct src dir.
I also tried npm install is-buffer -g to no avail. Any advice?
Unexpected token ILLEGAL
I was able to update the source to
var isBuf = require('C:\VF_PDO_APP\node_modules\is-buffer');
So now it seems to be going to the right place I think. Now however, I'm getting Unexpected token ILLEGAL.
C:\MY-APP\dataService>node dataAPI.js
C:\MY-APP\node_modules\socket.io\node_modules\socket.io-adapter\node_modules\socket.io-parser\binary.js:10
socket.io\node_modules\socket.io-adapter\node_modules\socket.io-parser
^^^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
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)
at require (module.js:384:17)
at Object.<anonymous> (C:\MY-APP\node_modules\socket.io\node_modules\soc
ket.io-adapter\node_modules\socket.io-parser\index.js:10:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
You first must install all your project dependencies, do it on the root folder of your project:
npm install
For your problem with socket.io try to:
npm install socket.io --save
For the bson problem:
npm install bson --save
(for this one probably you will need to install python and c++)

Resources