i try to run an angularjs applic, i understood that max version of node that can run it is 6.17.1
so i downloaded it using nvm, and then i run npm install but when i run npm start it failse and it looks like it downloade dependencis of higher versions that use es6 so thats why it fails.
i tried to downgrade specific libraries by deleting them from node modules and installing again specific lower version but when i tried npm show version it looks like its still use the higher version.
the error message is:
Failed to load external module #babel/register
[08:42:09] Requiring external module babel-register
C:\Users\s313240798\source\Workspaces\Nesher\Nesher\Nesher.Client\node_modules\micromatch\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Module._extensions..js (module.js:586:10)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\s313240798\source\Workspaces\Nesher\Nesher\Nesher.Client\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
i tried to run it also with higher version of node but then the app was on but faild because of th e Incompatibility of versions
This page has some suggestions which may help fix your issue: github.com/gulpjs/gulp/issues/1631
Have you tried this suggestion from the above web page?
npm i -S babel-register
Related
I read something about this error, but I have discord.js 13.6.0 and node 17.x.x
and I don't know what can couse it.
error:
Error: Cannot find module 'node:events'
Require stack:
- /home/runner/FittingAttachedHacks/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/FittingAttachedHacks/node_modules/discord.js/src/index.js
- /home/runner/FittingAttachedHacks/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous>
(/home/runner/FittingAttachedHacks/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
looks like you have installed link, but not the actual node version v17. Try uninstalling wrong package v17.4.0 and install the right version from official site of node.js
The required node version for discord js v13 is node verson of v16 or higher, without it you'll get error like:
1.AbortController is not defined
2.Unexpected token '?'
3.cannot find module 'node:events'
The simple solution is just upgrade to node v16 and the error will be fixed!
Download Node from the website or NVM (Node Version Manager) if you're using Linux.
NVM link: https://github.com/nvm-sh/nvm
I am currently learning react, and started a new app with create-react-app.
I navigated into the new app, then ran npm start.
I got this error message:
Error: Cannot find module '~/Desktop/forms-test/node_modules/postcss-safe-parser/node_modules/postcss/lib/tokenize'
at createEsmNotFoundErr (internal/modules/cjs/loader.js:907:15)
at finalizeEsmResolution (internal/modules/cjs/loader.js:900:15)
at resolveExports (internal/modules/cjs/loader.js:432:14)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (~/Desktop/forms-test/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
Any help would be very useful.
I am running Mac OS Catalina, using npm, and running zsh. I am using node version 14.13.1
For others digging around, I followed the instructions on this answer.
rm yarn.lock
yarn install
And that reinstalled everything and properly exported the lib/tokenize path inside of node_modules/postcss-safe-parser/node_modules/postcss/package.json.
I'm trying to debug my app. In the past everything worked perfectly. Then I formatted the computer, downloaded the project I had saved from git.
At this point, every time I try to run npm start in the terminal or to use the react native tool of visual studio code to debug the app or in any case to update the app connected to my device I get this error:
Error: Cannot find module '/Users/..../node_modules/#react-native-community/cli/build/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:338:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:719:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1072:27)
at Function.Module._load (internal/modules/cjs/loader.js:928:27)
at Module.require (internal/modules/cjs/loader.js:1145:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object.<anonymous> (/Users/.../node_modules/react-native/cli.js:12:11)
at Module._compile (internal/modules/cjs/loader.js:1256:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
at Module.load (internal/modules/cjs/loader.js:1105:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/..../node_modules/#react-native-community/cli/package.json',
requestPath: '#react-native-community/cli'
I don't understand how can I do.
I remember that before when I made a change to the code I just needed to run npm start to reload my project and see the changes in my device. Now I absolutely can't get the code and device to interact.
How can I do?
You try reinstall React LI:
npm install –g react-native-cli
and install dependences:
npm install
I am getting this error when use gulp serve from a angular-fullstack project generator. Please, how can I solve this issue? The dependencie was set in package.json properly.
[18:03:54] Requiring external module babel-register
/home/gcfabri/Workspace/sportfitness/gulpfile.babel.js:4
import _ from 'lodash';
^^^^^^
SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at loader (/home/gcfabri/node_modules/babel-register/lib/node.js:134:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/gcfabri/node_modules/babel-register/lib/node.js:144:7)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Liftoff.handleArguments (/home/gcfabri/.npm-global/lib/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff.<anonymous> (/home/gcfabri/.npm-global/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16)
It sounds like you need to run npm install --save babel-require. You can read more about it here.
Edit: Just to explain a bit better, the purpose of babel-require is to compile required packages with babel on the fly. In this case I'm assuming it's meant to be compiling ES6 javascript syntax back to ES5 syntax, because it's failing on the newer ES6 import syntax.
I'm not sure how babel ended up in your gulp pipeline there, but it's explicitly being required by something in /home/gcfabri/Workspace/sportfitness/gulpfile.babel.js. I wouldn't recommend removing it, but just so you have an idea of what's happening.
I hope installing that dependancy helps.
I would like to integrate Karma and webstorm for windows, I have followed the steps from this web:
http://mobicon.tistory.com/273 (translate it to english) but does not work.
I have created one Karma Server and a Karma run:
In Path to Node Js File textfield, I have pointed to a karma file from the node-modules:
C:\Users\xxx\AppData\Roaming\npm-cache\karma\0.8.4\package\bin\karma
In the application parameters for the server start and for the Karma Run run
I get the following errors:
module.js:340
throw err;
^
Error: Cannot find module 'optimist'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (C:\Users\Javito\AppData\Roaming\npm-cache\karma\0.8.4\package\lib\cli.js:2:16)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
Process finished with exit code 1
The problem was the Karma execution file (Path to node App JS file) I was pointing to, here is my configuration for both server and run:
Karma Server:
Karma Run:
Trying to run sails app(app.js nodejs) in Webstorm gave me the optimist error in Ubuntu 14(32 bits). I fixed it by running:
sudo npm install optimist
Cheers!