Whenever I try to run nodemon to auto-restart my local server (running on port 3000), I get this error message regarding a syntax error in the no
/Users/SI23/.nvm/versions/node/v6.5.0/lib/node_modules/nodemon/node_modules/chokidar/index.js:151
async remove(item) {
^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/SI23/.nvm/versions/node/v6.5.0/lib/node_modules/nodemon/lib/monitor/watch.js:6:16)
at Module._compile (module.js:556:32)
Any way to fix this?
As per my knowledge
Async Await is not available in node v6.5.0,
which you are using. So you can upgrade your node version or can start using Promise object with the same version of node.
In my case, npm list chokidar helped me realize it was another module (gulp-nodemon) that used a newer version of chokidar. It worked after downgrading it.
I had exactly the same error...! it was a node version problem, I was on node version 6, this is what I did to fix it:
nvm install <VERSION_NUMBER> // nvm install 10.15.3
nvm use <VERSION_NUMBER> // nvm use 10.15.3
node -v // confirm i am using the correct version of node
Remember to do this on your computer not just your code file and change the default node version with nvm alias default 10.15.3
you can check your default lists with
nvm list
Related
I'm new with code and apps either launching or trial. Recently I've been trying to set up a node on my mac terminal and experienced the below problems....
ironfish start
/usr/local/Cellar/ironfish/75/libexec/node_modules/bindings/bindings.js:121
throw e;
^
Error: The module '/usr/local/Cellar/ironfish/75/libexec/node_modules/segfault-handler/build/Release/segfault-handler.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1249:18)
at Module.load (node:internal/modules/cjs/loader:1043:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1067:19)
at require (node:internal/modules/cjs/helpers:103:18)
at bindings (/usr/local/Cellar/ironfish/75/libexec/node_modules/bindings/bindings.js:112:48)
at Object. (/usr/local/Cellar/ironfish/75/libexec/node_modules/segfault-handler/index.js:3:37)
at Module._compile (node:internal/modules/cjs/loader:1165:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
at Module.load (node:internal/modules/cjs/loader:1043:32) {
code: 'ERR_DLOPEN_FAILED'
}
I followed some solution similar to the err name but that didn't resolve it:
npm uninstall bcrypt
npm install bcryptjs
npm install bcrypt
it's not resolved. please assit
If this is a stupid question, I am sorry, but my code was literally working fine 2 days ago. Load it up today and I get all this bollocks. I am new to node and npm. So I am sorry if this is all just down to version management.
I am on linux ubuntu. I tested it in a new clean project, same error. Even tried to do something (literally just to check version number) in the terminal with npm, same error. I've done some searches which of some seem credible but I can't even do anything with npm at the moment so I can't even uninstall it or clean cache. Yes, I've tried with sudo.
npm does not support Node.js v10.19.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
/usr/local/lib/node_modules/npm/lib/npm.js:32
#unloaded = false
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:22:15)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
I can also run a new install of node but it will say:
nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).
Some what am I meant to do if these versions are incompatible?
Looks like your distro has a very old version of Node in its repository. If you want to upgrade it you'll need to install it through some other mechanism (such as nvm) and then make sure the new version takes precedence on your $PATH or upgrade to a new version of Ubuntu. -Quentin
This comment by Quentin was 100% the answer.
All I had to do was install NVM (Node Version Manager). Update the node package and everything was fine.
You can find NVM here: https://github.com/nvm-sh/nvm#installing-and-updating
I'm getting an error where the better_sqlite3 package is using a different version of node, and it says to try npm rebuild and npm install but this doesn't solve anything and I'm still getting the same error.
/home/nonce/Documents/Repositories/test/node_modules/bindings/bindings.js:121
throw e;
^
Error: The module '/home/nonce/Documents/Repositories/test/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at bindings (/home/nonce/Documents/Repositories/test/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/nonce/Documents/Repositories/test/node_modules/better-sqlite3/lib/database.js:9:24)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'ERR_DLOPEN_FAILED'
}
I don't think this is an error with better-sqlite3 itself, since I've done some research and a lot of people have gotten this sort of error, and the general solution is to execute npm rebuild but for me this doesn't do anything.
Solved the issue, I was using an outdated version of node as I was using node v16.13.2 so I tried switching to the most latest version (v17.4.0 as of now) and it works like a charm now.
i dont have errors when i install but when i require quick.db in my main.js (its a discord.js bot in v12)
const db = require('quick.db')
i have an better_sqlite3.node error in my terminal
-C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:121
throw e;
^
Error: The module '\\?\C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at bindings (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\lib\database.js:9:24)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'ERR_DLOPEN_FAILED'
}
PS C:\Users\Fatsah\Desktop\Wizzy Bot>
i tried to reinstall and update node.js into the last test
Node version : v16.7.0
Discord.js : v12.5.3
Npm Version : 7.20.3
I have this error not long ago, when I was using node v14 and I have the same with canvas / canvacord but is canvas.node
Reinstall all your dependencies, you probably upgraded Node after you installed better-sqlite3 and you need to rebuild the library again.
I am trying to create my first sails app and I've followed the steps on the sails getting started (http://sailsjs.org/get-started). But when i try to do a sails lift, i get the following error:
(node:11291) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
module.js:442
throw err;
^
Error: Cannot find module 'express/node_modules/cookie'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/hooks/session/index.js:9:12)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at /Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/app/configuration/index.js:54:28
at Function.reduce (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/node_modules/lodash/dist/lodash.js:3735:25)
at Configuration.defaultConfig (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/lib/app/configuration/index.js:53:18)
at Configuration.bound [as defaults] (/Users/master/Desktop/Developer/NodeJS/HelloSails/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
I tried manually removing the 'node_modules' folder, inserting express as a dependency in my package.json and running 'npm install', but that did not work.
Im running Node v6.2.2 Sail v0.10.5 and NPM v3.10.6
What am i missing here?
update sails version to latest, it is issue of npm structure, old version use tree level dependency while new version use same level structure
sails upgrade version
It's a dependency issue with npm, this worked for me when I had the issue.
npm -g install npm#latest