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"
}
}
Related
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"
}
}
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'm trying to use the bcrypt-package inside a vue-electron project, but there is an N-api version issue when I try to run it:
Uncaught Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
I'm running node 12.16.1.
I read up on the documentation about N-API, and according to that version matrix, it is not possible I have version 1 installed. But I can't find any further documentation on how to install/configure/manage these N-API versions.
My package.json:
{
"version": "0.0.1",
"license": null,
"engines": {
"node": "12.16.x"
},
"main": "./dist/electron/main.js",
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
"postinstall": ""
},
"build": {
"directories": {
"output": "build"
},
"files": [
"dist/electron/**/*"
],
"dmg": {
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"mac": {
"icon": "build/icons/icon.icns"
},
"win": {
"icon": "build/icons/icon.ico"
},
"linux": {
"icon": "build/icons"
}
},
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.27",
"#fortawesome/free-solid-svg-icons": "^5.12.1",
"#fortawesome/vue-fontawesome": "^0.1.9",
"axios": "^0.18.0",
"bcrypt": "^4.0.1",
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.7.0",
"dotenv": "^8.2.0",
"dotenv-webpack": "^1.7.0",
"mongoose": "^5.9.4",
"mongoose-uuid2": "^2.3.0",
"portal-vue": "^2.1.7",
"uuid": "^7.0.2",
"vue": "^2.5.16",
"vue-electron": "^1.0.6",
"vue-i18n": "^8.15.5",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"vuex-electron": "^1.0.0"
},
"devDependencies": {
"ajv": "^6.5.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-minify-webpack-plugin": "^0.3.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"cfonts": "^2.1.2",
"chalk": "^2.4.1",
"copy-webpack-plugin": "^4.5.1",
"cross-env": "^5.1.6",
"css-loader": "^0.28.11",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.4",
"electron-builder": "^20.19.2",
"electron-debug": "^1.5.0",
"electron-devtools-installer": "^2.2.4",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "0.4.0",
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"style-loader": "^0.21.0",
"url-loader": "^1.0.1",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.2.4",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^4.1.3"
}
}
Complete console stacktrace:
Uncaught Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
at Object.module.exports.validate_package_json (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/util/napi.js:82:9)
at Object.validate_config (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/util/versioning.js:229:10)
at Object.exports.find (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/pre-binding.js:21:15)
at Object.<anonymous> (/home/fabian/projects/prelude-pos/node_modules/bcrypt/bcrypt.js:5:27)
at Object.<anonymous> (/home/fabian/projects/prelude-pos/node_modules/bcrypt/bcrypt.js:238:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at eval (webpack-internal:///bcrypt:1:18)
at Object.bcrypt (http://localhost:9080/renderer.js:2844:1)
at __webpack_require__ (http://localhost:9080/renderer.js:727:30)
at fn (http://localhost:9080/renderer.js:102:20)
So far, I wiped and reinstalled nodejs, cleared the node_modules and reinstalled all the packages, but no difference there.
So I found an answer to my own question in the end:
Electron comes bundled with its own version of nodejs apparently. Updating electron fixed my error.
I'm trying to compile my project with babel. I'm getting this error when tried to run (I'm using babel as some code contain ES6)
/usr/local/bin/node -r babel-register /Volumes/Elements/Learning/Node/Project/building-apis-with-nodejs-master/ntask-api/index.js
/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
Error: Couldn't find preset "es2015" relative to directory "/Volumes/Elements/Learning/Node/Project/building-apis-with-nodejs-master/ntask-api"
at /Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
at Array.map (native)
at OptionManager.resolvePresets (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-register/lib/node.js:103:45)
at loader (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/Volumes/Elements/Dev/Node.js/building-apis-with-nodejs-master/ntask-api/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:488:32)
Process finished with exit code 1
Here is my package.json
{
"name": "ntask-api",
"version": "1.0.0",
"description": "Task list API",
"main": "index.js",
"scripts": {
"start": "npm run apidoc",
"clusters": "babel-node clusters.js",
"test": "NODE_ENV=test mocha test/**/*.js",
"apidoc": "apidoc -i routes/ -o public/apidoc"
},
"apidoc": {
"name": "Node Task API - Documentation",
"template": {
"forceLanguage": "en"
}
},
"author": "Vic",
"dependencies": {
"bcrypt": "^0.8.5",
"body-parser": "^1.15.0",
"compression": "^1.6.1",
"consign": "^0.1.2",
"cors": "^2.7.1",
"express": "^4.13.4",
"helmet": "^1.1.0",
"jwt-simple": "^0.4.1",
"morgan": "^1.6.1",
"passport": "^0.3.2",
"passport-jwt": "^2.0.0",
"sequelize": "^3.19.2",
"sqlite3": "^3.1.1",
"winston": "^2.1.1"
},
"devDependencies": {
"apidoc": "^0.15.1",
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.5.1",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.5.2",
"chai": "^3.5.0",
"mocha": "^2.4.5",
"supertest": "^1.2.0"
}
}
I have created my .babelrc
{
"presets": ["env","es2015"]
}
Anyone know what is wrong with the configuration? I'm using babel with express.js.