I was working on a technical test in node js, and I got this error "Please install sqlite3 package manually" when I ran npm start.
I searched for the answer on the internet for several days. I tried npm rebuild, npm i sqlite3, updating node, and some other things
I suspect it has something to do with my mac M1, I've encountered compatibility issues in the past, but I could be wrong.
I use node v16.14.2 and sqlite3 3.36.0.
Any help would be appreciated
Here is the full error:
Error: Please install sqlite3 package manually
at ConnectionManager._loadDialectModule (/Users/arthur/Documents/candidate-takehome/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:55:15)
at new ConnectionManager (/Users/arthur/Documents/candidate-takehome/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:18:21)
at new SqliteDialect (/Users/arthur/Documents/candidate-takehome/node_modules/sequelize/lib/dialects/sqlite/index.js:13:30)
at new Sequelize (/Users/arthur/Documents/candidate-takehome/node_modules/sequelize/lib/sequelize.js:188:20)
at Object.<anonymous> (/Users/arthur/Documents/candidate-takehome/models/index.js:15:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
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)
Here is my package json:
"name": "game-viewer-tool",
"version": "1.0.0",
"description": "Game Viewer Tool",
"main": "index.js",
"scripts": {
"start": "node index.js",
"eslint": "./node_modules/.bin/eslint .",
"test": "NODE_ENV=test node_modules/.bin/sequelize db:migrate; NODE_ENV=test ./node_modules/.bin/mocha --exit 'test/*.js'; rm ./database_test.sqlite3"
},
"license": "UNLICENSED",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"sequelize": "^6.17.0",
"sequelize-cli": "^5.5.0",
"sqlite3": "^5.0.2"
},
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-vue": "^5.2.3",
"expect": "^24.8.0",
"husky": "^1.3.1",
"jest": "^23.6.0",
"lint-staged": "^8.1.5",
"mocha": "^6.1.4",
"nodemon": "^1.18.10",
"sinon": "^7.3.2",
"supertest": "^4.0.2"
}
}
Related
i have created an app which i am running it on my windows pc and works fine. is a MERN application now i have seted up a machine with ubuntu so i can serve it. but i cant run the back end i have the following error:
import mongoose from "mongoose"; ^^^^^^^^ SyntaxError: Unexpected identifier 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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)`
all node modules are installed,
node installed 10.19.0,
npm installed,
mongo db installed,
nodemodules installed,
"type":"module" is on json file:
{
"name": "myidea",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"serve": "npx nodemon index.js",
"seed": "node db/seeds.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.1.0",
"body-parser": "^1.20.1",
"crypto-js": "^4.1.1",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"gridfs-stream": "^1.1.1",
"jsonwebtoken": "^8.5.1",
"method-override": "^3.0.0",
"mongoose": "^6.6.5",
"mongoose-unique-validator": "^3.1.0",
"multer-gridfs-storage": "^5.0.2"
},
"type": "module"
}
But still when i do npm run serve or npm run seed i have the error above. what em i missing here?
i have tried npm run serve and npm run seed and still i am getting the same error despite the fact ii have added the "type":"module" on the json
So I tried to remove some files for code cleanup and some normalization. However express then gives me an error of: "Cannot find module './jobs.resolver'" Which is one of the files I removed.
Here is my package.json:
{
"name": "typegraphql-tutorial",
"version": "1.0.0",
"main": "dist/index",
"typings": "dist/index",
"author": "Tom Nagle",
"license": "MIT",
"scripts": {
"dev": "ts-node-dev --respawn --transpile-only --exit-child --watch src src/index.ts",
"start": "node ./src/index.ts"
},
"dependencies": {
"#typegoose/typegoose": "^9.7.1",
"apollo-server": "^3.5.0",
"bcrypt": "^5.0.1",
"bcryptjs": "^2.4.3",
"class-validator": "^0.13.2",
"config": "^3.3.6",
"cookie-parser": "^1.4.6",
"dotenv": "^10.0.0",
"express": "^4.17.3",
"graphql": "15.x",
"jsonwebtoken": "^8.5.1",
"mongoose": "^6.2.9",
"nanoid": "^3.1.30",
"reflect-metadata": "^0.1.13",
"type-graphql": "^1.1.1"
},
"devDependencies": {
"#types/bcrypt": "^5.0.0",
"#types/config": "^0.0.40",
"#types/cookie-parser": "^1.4.2",
"#types/jsonwebtoken": "^8.5.6",
"ts-node-dev": "^1.1.8",
"typescript": "^4.5.2"
}
}
Here is the error stack:
Error: Cannot find module './jobs.resolver'
Require stack:
- B:\jrevsols\jrevsolsBE\src\resolvers\index.ts
- B:\jrevsols\jrevsolsBE\src\index.ts
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (B:\jrevsols\jrevsolsBE\src\resolvers\index.ts:4:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module._compile (B:\jrevsols\jrevsolsBE\node_modules\source-map-support\source-map-support.js:568:25)
at Module.m._compile (C:\Users\Bon\AppData\Local\Temp\ts-node-dev-hook-9024418715050684.js:69:33)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at require.extensions.<computed> (C:\Users\Bon\AppData\Local\Temp\ts-node-dev-hook-9024418715050684.js:71:20)
[ERROR] 20:56:46 Error: Cannot find module './jobs.resolver'
Require stack:
- B:\jrevsols\jrevsolsBE\src\resolvers\index.ts
- B:\jrevsols\jrevsolsBE\src\index.ts
Not really sure why this is happening and searching the issue most of them are unreleated
the node sass has a compatible problem with the Apple M1, this is the error when I build the project in M1:
[./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js!./src/css/options.scss] ./node_modules/css-loader/dist/cjs.js??ref--4-2!./node_modules/postcss-loader/src??ref--4-3!./node_modules/sass-loader/dist/cjs.js!./src/css/options.scss 1.54 KiB {mini-css-extract-plugin} [built] [failed] [1 error]
ERROR in ./src/css/options.scss (./node_modules/css-loader/dist/cjs.js??ref--4-2!./node_modules/postcss-loader/src??ref--4-3!./node_modules/sass-loader/dist/cjs.js!./src/css/options.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/node-sass/lib/binding.js:13:13)
at Object.<anonymous> (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
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 (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at getDefaultSassImplementation (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/sass-loader/dist/utils.js:43:10)
at getSassImplementation (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/sass-loader/dist/utils.js:57:30)
at Object.loader (/Users/xiaoqiangjiang/source/reddwarf/frontend/Cruise-Radar/node_modules/sass-loader/dist/index.js:34:59)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have check my package.json and found I did not use node sass, just use less, this is the less version:
"less": "3.12.2",
what should I do to fix this problem? I have downgrade from node 17 to 16. BTW, this is the package.json:
{
"name": "cruise-radar",
"version": "0.0.1",
"description": "Browser extension to detect available RSS and RSSHub for current page",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w --mode=development --progress --display-error-details --colors",
"build": "webpack --mode=development --progress --display-error-details --colors",
"release": "npm run build && zip -r release/radar.zip dist",
"format": "eslint \"**/*.js\" --fix && prettier \"**/*.{js,scss,less}\" --write",
"format:staged": "eslint \"**/*.js\" --fix && pretty-quick --staged --verbose --pattern \"**/*.{js,scss,less}\"",
"format:check": "eslint \"**/*.js\" && prettier-check \"**/*.{js,scss,less}\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/jiangxiaoqiang/Cruise-Radar.git"
},
"keywords": [
"rsshub",
"rss"
],
"gitHooks": {
"pre-commit": "npm run format:staged"
},
"author": "DIYgod",
"license": "MIT",
"bugs": {
"url": "https://github.com/DIYgod/RSSHub-Radar/issues"
},
"homepage": "https://github.com/DIYgod/RSSHub-Radar#readme",
"devDependencies": {
"#babel/core": "7.12.3",
"#babel/preset-env": "7.12.1",
"#fingerprintjs/fingerprintjs": "3.1.2",
"autoprefixer": "9.8.6",
"babel-loader": "8.1.0",
"babel-plugin-component": "1.1.1",
"copy-webpack-plugin": "6.3.0",
"css-loader": "5.0.1",
"cssnano": "4.1.10",
"eslint": "7.13.0",
"eslint-config-prettier": "6.15.0",
"eslint-loader": "4.0.2",
"eslint-plugin-prettier": "3.1.4",
"file-loader": "6.2.0",
"less": "3.12.2",
"less-loader": "7.0.2",
"mini-css-extract-plugin": "1.3.0",
"postcss-loader": "3.0.0",
"prettier": "2.1.2",
"prettier-check": "2.0.0",
"pretty-quick": "3.1.0",
"sass-loader": "^10",
"svg-inline-loader": "0.8.2",
"template-string-optimize-loader": "3.0.0",
"url-loader": "4.1.1",
"vue": "2.6.12",
"vue-loader": "15.9.5",
"vue-template-compiler": "2.6.12",
"webpack": "4.44.2",
"webpack-cli": "3.3.12",
"yorkie": "2.0.0"
},
"dependencies": {
"clipboard": "2.0.6",
"element-ui": "2.14.0",
"md5.js": "^1.3.5",
"psl": "1.8.0",
"route-recognizer": "0.3.4",
"rss-parser": "3.9.0",
"vue-router": "3.4.9",
"yarn": "^1.22.17"
}
}
I am building a React app. I installed yargs and argsert manually by npm. For some reason, when I start the development server, I get the following error and stack trace. The two modules in question are listed clearly as argsert and yargs. I am unsure of how to proceed. Any feedback would be greatly appreciated.
webpack-dev-server --mode development
module.js:549
throw err;
^
Error: Cannot find module './lib/argsert'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/josh/devel/react-app/frontend/node_modules/webpack-dev-server/node_modules/yargs/yargs.js:2:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
package.json
{
"name": "react-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --mode development",
"build": "webpack --mode production",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#babel/core": "^7.8.7",
"#babel/preset-env": "^7.8.7",
"#babel/preset-react": "^7.8.3",
"babel-loader": "^8.0.6",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"argsert": "^1.0.9",
"babel-loader": "^8.0.6",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-router-dom": "^5.1.2",
"weak-key": "^1.0.1",
"yargs": "^15.3.1"
}
}
Use npm i argsert yargs if it is not working working try to npm install if even tough it is not working. Delete argsert and yargs from package.json and install it again.
I have installed node and npm from source and that seems to have fixed the issue. Thanks for the help everyone.
I have been breaking my head on installing emberfire to set up a backend and database for working with my front end ember app. I cleaned up node_modules, did a fresh npm install and also did npm cache clean. Gave up trying to fix it.
When i run,
$ ember install emberfire
i am getting below error.
Installed packages for tooling via npm.
Unexpected token ;
SyntaxError: Unexpected token ;
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Project.require (C:\Users\vignesh\Documents\Developer\MyTechStack\library-ember-app\node_modules\ember-cli\lib\models\project.js:285:12)
at Project.config (C:\Users\vignesh\Documents\Developer\MyTechStack\library-ember-app\node_modules\ember-cli\lib\models\project.js:201:26)
at CoreObject.extend.install (C:\Users\vignesh\Documents\Developer\MyTechStack\library-ember-app\node_modules\ember-cli\lib\models\blueprint.js:435:34)
Steps i tried till now
Cleaned the node_modules and did npm install again.
Installed ember-cli globally.
Cleared the cache.
My package.json looks like this
{
"name": "library-ember-app",
"version": "0.0.0",
"description": "Small description for library-ember-app goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.4.2",
"ember-ajax": "^2.0.1",
"ember-cli": "2.7.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-babel": "^5.1.6",
"ember-cli-bootstrap-sassy": "0.5.3",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.3",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.4.0",
"ember-cli-jshint": "^1.0.0",
"ember-cli-qunit": "^2.0.0",
"ember-cli-release": "^0.2.9",
"ember-cli-sass": "5.4.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.7.0",
"ember-export-application-global": "^1.0.5",
"ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3",
"ember-welcome-page": "^1.0.1",
"emberfire": "2.0.1"
}
}
Bower.json
{
"name": "library-ember-app",
"dependencies": {
"ember": "~2.7.0",
"ember-cli-shims": "0.1.1",
"ember-qunit-notifications": "0.1.0",
"bootstrap-sass": "^3.3.7",
"firebase": "^3.0.0"
}
}