Related
Update.. I moved the app to Vercel instead of DigitalOcean and It works fine.
"Vercel is not requiring a build file before deploying the app if it's NextJs App, Vercel will create the build files and deploy the app without any configurations "
"
Can someone help me understand where is the problem.
I'm a new programmer and this my first time working with NextJs.
I've create a one page website and I'm trying to deploying it using digitalocean but it keeps giving me this error: "ERROR: failed to build: exit status 1"
[2023-02-05 15:01:31] ╭──────────── git repo clone ───────────╼
[2023-02-05 15:01:31] │ › fetching app source code
[2023-02-05 15:01:31] │ => Selecting branch "prod"
[2023-02-05 15:01:33] │ => Checking out commit "dda440fddc95f99345f3520f51872634dc298a02"
[2023-02-05 15:01:33] │
[2023-02-05 15:01:33] │ ✔ cloned repo to /workspace
[2023-02-05 15:01:33] ╰────────────────────────────────────────╼
[2023-02-05 15:01:33]
[2023-02-05 15:01:33] › configuring custom build command to be run at the end of the build:
[2023-02-05 15:01:33] │ npm run export
[2023-02-05 15:01:33]
[2023-02-05 15:01:33] ╭──────────── buildpack detection ───────────╼
[2023-02-05 15:01:33] │ › using Ubuntu 18.04 stack
[2023-02-05 15:01:33] │ Detected the following buildpacks suitable to build your app:
[2023-02-05 15:01:33] │
[2023-02-05 15:01:33] │ heroku/nodejs-engine v0.5.1
[2023-02-05 15:01:33] │ digitalocean/node v0.3.4 (Node.js)
[2023-02-05 15:01:33] │ digitalocean/procfile v0.0.3 (Procfile)
[2023-02-05 15:01:33] │ digitalocean/custom v0.1.1 (Custom Build Command)
[2023-02-05 15:01:33] │
[2023-02-05 15:01:33] │ For documentation on the buildpacks used to build your app, please see:
[2023-02-05 15:01:33] │
[2023-02-05 15:01:33] │ Node.js v0.3.4 https://do.co/apps-buildpack-node
[2023-02-05 15:01:33] ╰─────────────────────────────────────────────╼
[2023-02-05 15:01:33]
[2023-02-05 15:01:33] ╭──────────── app build ───────────╼
[2023-02-05 15:01:33] │ ---> Node.js Buildpack
[2023-02-05 15:01:33] │ ---> Installing toolbox
[2023-02-05 15:01:33] │ ---> - jq
[2023-02-05 15:01:34] │ ---> - yj
[2023-02-05 15:01:34] │ ---> Getting Node version
[2023-02-05 15:01:34] │ ---> Resolving Node version
[2023-02-05 15:01:35] │ ---> Downloading and extracting Node v16.19.0
[2023-02-05 15:01:39] │ ---> Parsing package.json
[2023-02-05 15:01:39] │ ---> No file to start server
[2023-02-05 15:01:39] │ ---> either use 'docker run' to start container or add index.js or server.js
[2023-02-05 15:01:39] │ Project contains package-lock.json, using npm
[2023-02-05 15:01:40] │ Found npm version range "~1.0.20" in package.json->engines.npm
[2023-02-05 15:01:40] │ Installing npm "~1.0.20"
[2023-02-05 15:01:41] │ npm ERR! code ETARGET
[2023-02-05 15:01:41] │ npm ERR! notarget No matching version found for npm#~1.0.20.
[2023-02-05 15:01:41] │ npm ERR! notarget In most cases you or one of your dependencies are requesting
[2023-02-05 15:01:41] │ npm ERR! notarget a package version that doesn't exist.
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │ npm ERR! A complete log of this run can be found in:
[2023-02-05 15:01:41] │ npm ERR! /home/apps/.npm/_logs/2023-02-05T15_01_41_127Z-debug-0.log
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │ unable to invoke layer creator
[2023-02-05 15:01:41] │ installing npm: exit status 1
[2023-02-05 15:01:41] │ ERROR: failed to build: exit status 1
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │ For documentation on the buildpacks used to build your app, please see:
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │ Node.js v0.3.4 https://do.co/apps-buildpack-node
[2023-02-05 15:01:41] │
[2023-02-05 15:01:41] │ ✘ build failed
[]
In the editor I followed the instruction on this link [app-nextjs-deploy](https://docs.digitalocean.com/tutorials/app-nextjs-deploy/) and when I run the npm run build it run succsusfuly.
This is the return:
/Desktop/code_projects/3dotsdev (prod)~$ npm run build
> 3dot#0.1.0 build /Users/baraa/Desktop/code_projects/3dotsdev
> next build
info - Linting and checking validity of types
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
[ ] info - Generating static pages (0/12)next-translate - compiled page: /about-us - locale: ar - namespaces: common - used loader: getStaticProps
next-translate - compiled page: /about-us - locale: en - namespaces: common - used loader: getStaticProps
next-translate - compiled page: / - locale: ar - namespaces: common, hero, contact, footer, ourWork, services, header, overview, projects - used loader: getStaticProps
next-translate - compiled page: / - locale: en - namespaces: common, hero, contact, footer, ourWork, services, header, overview, projects - used loader: getStaticProps
next-translate - compiled page: /projectPreview - locale: en - namespaces: common - used loader: getStaticProps
next-translate - compiled page: /projectPreview - locale: ar - namespaces: common - used loader: getStaticProps
info - Generating static pages (12/12)
info - Finalizing page optimization
Route (pages) Size First Load JS
┌ ● / 502 B 99.5 kB
├ /_app 0 B 99 kB
├ ○ /404 182 B 99.1 kB
├ ● /about-us 1.1 kB 100 kB
└ ● /projectPreview 751 B 99.7 kB
+ First Load JS shared by all 104 kB
├ chunks/framework-ab06527bed40be7f.js 45.4 kB
├ chunks/main-a091f637108a345e.js 27 kB
├ chunks/pages/_app-35010f633d6867e6.js 24.5 kB
├ chunks/webpack-82c27b893a0dceeb.js 2.07 kB
└ css/6192469adf69fe6c.css 4.83 kB
○ (Static) automatically rendered as static HTML (uses no initial props)
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
And when I continue and run "npm run export" to show me the "_static" file, an error will show in the editor console :
/Desktop/code_projects/3dotsdev (prod)~$ npm run export
> 3dot#0.1.0 export /Users/baraa/Desktop/code_projects/3dotsdev
> npm run build && next export -o _static
> 3dot#0.1.0 build /Users/baraa/Desktop/code_projects/3dotsdev
> next build
info - Linting and checking validity of types
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
[ ] info - Generating static pages (0/12)next-translate - compiled page: / - locale: en - namespaces: common, hero, contact, footer, ourWork, services, header, overview, projects - used loader: getStaticProps
next-translate - compiled page: /projectPreview - locale: ar - namespaces: common - used loader: getStaticProps
next-translate - compiled page: /projectPreview - locale: en - namespaces: common - used loader: getStaticProps
next-translate - compiled page: /about-us - locale: en - namespaces: common - used loader: getStaticProps
next-translate - compiled page: / - locale: ar - namespaces: common, hero, contact, footer, ourWork, services, header, overview, projects - used loader: getStaticProps
next-translate - compiled page: /about-us - locale: ar - namespaces: common - used loader: getStaticProps
info - Generating static pages (12/12)
info - Finalizing page optimization
Route (pages) Size First Load JS
┌ ● / 502 B 99.5 kB
├ /_app 0 B 99 kB
├ ○ /404 182 B 99.1 kB
├ ● /about-us 1.1 kB 100 kB
└ ● /projectPreview 751 B 99.7 kB
+ First Load JS shared by all 104 kB
├ chunks/framework-ab06527bed40be7f.js 45.4 kB
├ chunks/main-a091f637108a345e.js 27 kB
├ chunks/pages/_app-35010f633d6867e6.js 24.5 kB
├ chunks/webpack-82c27b893a0dceeb.js 2.07 kB
└ css/6192469adf69fe6c.css 4.83 kB
○ (Static) automatically rendered as static HTML (uses no initial props)
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
info - using build directory: /Users/baraa/Desktop/code_projects/3dotsdev/.next
info - Copying "static build" directory
info - No "exportPathMap" found in "/Users/baraa/Desktop/code_projects/3dotsdev/next.config.js". Generating map from "./pages"
Error: i18n support is not compatible with next export. See here for more info on deploying: https://nextjs.org/docs/deployment
at /Users/baraa/Desktop/code_projects/3dotsdev/node_modules/next/dist/export/index.js:147:19
at async Span.traceAsyncFn (/Users/baraa/Desktop/code_projects/3dotsdev/node_modules/next/dist/trace/trace.js:79:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 3dot#0.1.0 export: `npm run build && next export -o _static`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 3dot#0.1.0 export script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/baraa/.npm/_logs/2023-02-05T15_44_13_947Z-debug.log
THIS IS THE LOG FOR THE "npm run export"
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/Users/baraa/.nvm/versions/node/v14.17.6/bin/node',
1 verbose cli '/Users/baraa/.nvm/versions/node/v14.17.6/bin/npm',
1 verbose cli 'run',
1 verbose cli 'export'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.17.6
4 verbose run-script [ 'preexport', 'export', 'postexport' ]
5 info lifecycle 3dot#0.1.0~preexport: 3dot#0.1.0
6 info lifecycle 3dot#0.1.0~export: 3dot#0.1.0
7 verbose lifecycle 3dot#0.1.0~export: unsafe-perm in lifecycle true
8 verbose lifecycle 3dot#0.1.0~export: PATH: /Users/baraa/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/baraa/Desktop/code_projects/3dotsdev/node_modules/.bin:/Users/baraa/.nvm/versions/node/v14.17.6/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/baraa/.nvm/versions/node/v14.17.6/bin
9 verbose lifecycle 3dot#0.1.0~export: CWD: /Users/baraa/Desktop/code_projects/3dotsdev
10 silly lifecycle 3dot#0.1.0~export: Args: [ '-c', 'npm run build && next export -o _static' ]
11 silly lifecycle 3dot#0.1.0~export: Returned: code: 1 signal: null
12 info lifecycle 3dot#0.1.0~export: Failed to exec export script
13 verbose stack Error: 3dot#0.1.0 export: `npm run build && next export -o _static`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/Users/baraa/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (/Users/baraa/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid 3dot#0.1.0
15 verbose cwd /Users/baraa/Desktop/code_projects/3dotsdev
16 verbose Darwin 22.2.0
17 verbose argv "/Users/baraa/.nvm/versions/node/v14.17.6/bin/node" "/Users/baraa/.nvm/versions/node/v14.17.6/bin/npm" "run" "export"
18 verbose node v14.17.6
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error 3dot#0.1.0 export: `npm run build && next export -o _static`
22 error Exit status 1
23 error Failed at the 3dot#0.1.0 export script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
And this my Package.json :
{
"name": "3dot",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p 3010",
"lint": "next lint",
"export": "npm run build && next export -o _static"
},
"dependencies": {
"eslint": "8.26.0",
"eslint-config-next": "13.0.2",
"next": "13.0.2",
"next-translate": "^1.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scroll": "^1.8.9",
"tailwindcss-rtl": "^0.9.0",
"taos": "^1.0.2"
},
"engines": {
"node": "^14.17.6",
"npm": "~6.14.15"
},
"devDependencies": {
"autoprefixer": "^10.4.13",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"tailwindcss": "^3.2.1"
}
}
If anyone have any Idea please tell me.
When I start my react project in Fedora 32 using command yarn start, it shows error like this:
./src/style/base.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./src/style/base.scss)
Error: Node Sass does not yet support your current environment: Linux 64-bit 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
My current node version is:
[dolphin#MiWiFi-R4CM-srv]~/Documents/GitHub/react-admin% nvm list
v8.17.0
v10.24.1
-> v16.13.0
v17.2.0
system
default -> 8 (-> v8.17.0)
I have tried different version of node but did not fix this problem, why did this happen? what should I do to fix this problem? I did not found any package dependencies of node-sass in the package.json, this is the package.json file:
{
"name": "react-admin",
"version": "0.1.0",
"private": true,
"dependencies": {
"#ant-design/compatible": "1.0.8",
"animate.css": "^3.7.2",
"antd": "^4.0.0",
"axios": "^0.19.0",
"braft-editor": "^2.3.8",
"echarts": "^4.4.0",
"is-core-module": "2.2.0",
"moment": "2.29.1",
"nprogress": "^0.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-highlight-words": "0.17.0",
"react-loadable": "^5.5.0",
"react-redux": "^7.1.1",
"react-router-dom": "^5.1.1",
"react-scripts": "^3.2.0",
"redux": "^4.0.4",
"redux-logger": "3.0.6",
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.3.0",
"screenfull": "^5.0.0"
},
"scripts": {
"start": "react-app-rewired start",
"build": "CI=false && react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"node_modules/.bin/prettier --write",
"git add"
],
"src/**/*.{css,scss,less,json,html,md,markdown}": [
"node_modules/.bin/prettier --write",
"git add"
]
},
"devDependencies": {
"#babel/helper-builder-react-jsx": "^7.12.13",
"babel-plugin-import": "^1.12.2",
"customize-cra": "^0.8.0",
"husky": "^3.0.9",
"lint-staged": "^9.4.2",
"sass": "1.37.0",
"prettier": "^1.18.2",
"react-app-rewired": "^2.1.4"
}
}
First solution
Make sure your node.js version is not superior to the recommended one. If not downgrade it, and for that, you could use n package from npm:
npm i -g n
n stable
# if one of the commands does not pass, you may need to use sudo
sudo npm install -g n
sudo n 14
Then you would wanna use sass package instead of node-sass, as it's deprecated. And for that run in your terminal:
npm uninstall node-sass --save
npm install sass --save
Second solution
If you need or want node-sass for some reason, you should downgrade your nodejs version to like v14. For that you can use n package from npm:
npm install -g n
n 14
# if one of the commands does not pass, you may need to use sudo
sudo npm install -g n
sudo n 14
This is a common node-sass version compatibility problem with the Node version.
Quick hack:
Uninstall and reinstall node-sass, and it will find the missing binary for itself.
npm uninstall --save-dev node-sass
npm install --save-dev node-sass
Permanent solution:
If the issue is not resolved using the above commands, there may be a problem with your node version. Check that your node version supports node-sass version. Chose a stable node version and repeat the above commands to fix this issue.
Below is the compatibility table of the node with node-sass:-
NodeJS | Supported node-sass version | Node Module
Node 17 7.0+ 102
Node 16 6.0+ 93
Node 15 5.0+ 88
Node 14 4.14+ 83
Node 13 4.13+, <5.0 79
Node 12 4.12+ 72
Node 11 4.10+, <5.0 67
Node 10 4.9+, <6.0 64
Node 8 4.5.3+, <5.0 57
Node <8 <5.0 <57
If the issue is still not fixed, check the node-sass supported environment's list:-
https://github.com/sass/node-sass/releases/
I ran into the same problem when deploying an already existing application.
And it helped me to downgrade the Node version.
When developing the application, Node v14.19.2 was used, version Node 16.18.0 was installed locally. node-sass has a dependency on the Node version according to the following scheme:
┌────┬─────────┬─────────────────────────────┬─────────────┐
│ │ A │ B │ C │
├────┼─────────┼─────────────────────────────┼─────────────┤
│ 1 │ NodeJS │ Supported node-sass version │ Node Module │
│ 2 │ Node 19 │ 8.0+ │ 111 │
│ 3 │ Node 18 │ 8.0+ │ 108 │
│ 4 │ Node 17 │ 7.0+, <8.0 │ 102 │
│ 5 │ Node 16 │ 6.0+ │ 93 │
│ 6 │ Node 15 │ 5.0+, <7.0 │ 88 │
│ 7 │ Node 14 │ 4.14+ │ 83 │
│ 8 │ Node 13 │ 4.13+, <5.0 │ 79 │
│ 9 │ Node 12 │ 4.12+, <8.0 │ 72 │
│ 10 │ Node 11 │ 4.10+, <5.0 │ 67 │
│ 11 │ Node 10 │ 4.9+, <6.0 │ 64 │
│ 12 │ Node 8 │ 4.5.3+, <5.0 │ 57 │
│ 13 │ Node <8 │ <5.0 │ <57 │
└────┴─────────┴─────────────────────────────┴─────────────┘
Based on the dependencies in the table, I installed Node version 14, which corresponds to the node-sass version from package.json and everything worked
"node-sass": "^4.14.1",
I tried to change the node-sass version, but I didn't succeed. I was able to solve the problem only by downgrading the Node version
Sometimes, after changing the Node version, you need to run the command:
npm rebuild node-sass
I'm totally lost at this point on how to get ESLint to install and function using Atom. So I'm going to post a step by step and would be really awesome if someone could help be get this working.
Atom: 1.19.5
Atom, linter 2.2.0
Atom, linter-eslint 8.2.1
I've uninstalled and reinstalled the Atom plugins and have disabled all other plugins besides those in Core and the 2 linters.
npm list -g --depth=0
All Global Installs:
├── create-react-app#1.0.4
├── create-react-native-app#1.0.0
├── eslint#4.6.1
├── express-generator#4.14.1
├── json-server#0.9.5
├── mocha#3.2.0
├── nodemon#1.11.0
├── npm#3.10.10
├── pushstate-server#2.2.1
├── react-native-cli#2.0.1
├── react-vr-cli#0.3.5
├── webpack#2.2.1
├── webpack-dev-server#2.3.0
└── yarn#0.21.3
These are the attempted steps I've done to get eslint to work in my Atom project:
npm install -g eslint
cd /into/project
eslint --init
? How would you like to configure ESLint? > User a popular style guide
? Which style guide do you want to follow? >Airbnb
? Do you use React? > y
? What format do you want your config file to be in? > JSON
Delete /node_modules
npm install
/project
/node_modules
.eslintrc.json
index.js
package.json
.eslintrc.json
{
"extends": "airbnb"
}
package.json
{
"name": "lint-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"eslint": "^4.6.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-rallycoding": "^3.2.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0"
}
}
index.js
This is just a file trying to get some type of results from eslint
Errors
[Linter] Error running ESLint (Open developer console)
Configuration for rule "jsx-a11y/anchor-has-content" is invalid: Value "[object Object]" no (or more than one) schemas match.
So went to eslint-plugin-jsx #168
No errors are appearing in the Atom developer console. But also nothing is happening with the Linter in the Atom editor. I can type gibberish and nothing happens.
Running Debug
DEBUG=eslint:* eslint .
Debug results:
Cannot find module 'eslint-config-airbnb'
Referenced from: /Users/user/development/lint-test/.eslintrc.json
Error: Cannot find module 'eslint-config-airbnb'
Referenced from: /Users/user/development/lint-test/.eslintrc.json
at ModuleResolver.resolve (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/util/module-resolver.js:74:19)
at resolve (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:515:25)
at load (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:584:26)
at configExtends.reduceRight.e (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:421:36)
at Array.reduceRight (native)
at applyExtends (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:403:28)
at loadFromDisk (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:556:22)
at Object.load (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config/config-file.js:592:20)
at Config.getLocalConfigHierarchy (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config.js:226:44)
at Config.getConfigHierarchy (/Users/user/.nvm/versions/node/v6.9.5/lib/node_modules/eslint/lib/config.js:180:43)
At this point I'm assuming it's trying to read from the global not local
eslint eslint-config-airbnb error #465
updated .eslintrc.json to "extends": "eslint-config-airbnb",
Now again nothing is happening, run debug again
DEBUG=eslint:* eslint .
Still can't find the module
Try suggestions in Configuring Atom editor with eslint
At this point I'm still running into Cannot find module 'eslint-config-airbnb'
Followed npm eslint-config-airbnb
ran all the commands
New local package.json
"devDependencies": {
"eslint": "^4.6.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0"
}
npm install -g eslint-config-airbnb
New Global Modules
├── create-react-app#1.0.4
├── create-react-native-app#1.0.0
├── eslint#4.6.1
├── eslint-config-airbnb#15.1.0
├── eslint-plugin-import#2.7.0
├── UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y#6.0.2
├── eslint-plugin-react#7.3.0
├── express-generator#4.14.1
├── install-peerdeps#1.1.3
├── json-server#0.9.5
├── mocha#3.2.0
├── nodemon#1.11.0
├── npm#3.10.10
├── pushstate-server#2.2.1
├── react-native-cli#2.0.1
├── react-vr-cli#0.3.5
├── webpack#2.2.1
├── webpack-dev-server#2.3.0
└── yarn#0.21.3
So now I can run DEBUG=eslint:* eslint . and can get some results. However nothing ever runs in Atom.
Results:
/Users/user/development/lint-test/index.js
1:1 error Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash
1:7 error 'config' is assigned a value but never used no-unused-vars
1:24 error Unable to resolve path to module '../something' import/no-unresolved
1:39 error Missing semicolon semi
✖ 4 problems (4 errors, 0 warnings)
1 error, 0 warnings potentially fixable with the `--fix` option.
At this point I'm out of ideas on how to get Atom to actually work with eslint...
uncheck the setting "Use global ESLint installation" in linter-eslint of ATOM will make it correct
Without digging into the issue and finding specific point of failure I decided on a fresh start.
Delete global node modules.
Delete all NON core Atom plugins AND themes.
uninstall Atom.
reinstall Atom.
install ESLint and supporting dependencies only.
Doing that I was able to run ESLint with no issues. My assumption in all of this is there was a conflict in a plugin or theme. From there installing my core tool plugins was successful.
I installed node.js because I needed a way for storing my javascript variables into a mysql database (I use phpmyadmin).
I'm getting this error and I just don't now what to do with it:
C:\Users\Robin> npm install mysql
C:\Users\Robin
`-- mysql#2.13.0
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Robin\package.json'
npm WARN Robin No description
npm WARN Robin No repository field.
npm WARN Robin No README data
npm WARN Robin No license field.
I also typed another command (can't remember which one) and it gave me a list of what looks like usernames and email-accounts.
I have no idea which steps I need to take for succesfully installing node.js and make it work. I checked youtube video's and stuff but there like worthless.
So my question from scrath is: I installed node.js, how to make it work?
Kind regards from the Netherlands
Well, I may get your problem . Then i searched and found some valuable steps for you from the internet .
Create a new project: mkdir mysql-test && cd mysql-test.
Create a package.json file: npm init -y.
Install the mysql module: npm install mysql.
Create an app.js file and copy in the snippet below (editing the placeholders as appropriate).
Run the file: node app.js. Observe a “Connected!” message
Here is the Url where i got these information :https://www.sitepoint.com/using-node-mysql-javascript-client/
Best of luck .
You need have package.json file.
Do first:
npm init
Then you will have package.json. Now you can do:
npm install package
Or
npm install package --save (for save dependencies in package.json)
EDIT:
Iam trying do npm intall in a void folder in my coputer:
diego.martin#csa-188:~/Proyectos/pruebas/prueba$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (prueba) Hello
Sorry, name can no longer contain capital letters.
name: (prueba) hello
version: (1.0.0)
description: None
entry point: (index.js)
test command:
git repository:
keywords:
author: Diego
license: (ISC)
About to write to /home/diego.martin/Proyectos/pruebas/prueba/package.json:
{
"name": "hello",
"version": "1.0.0",
"description": "None",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Diego",
"license": "ISC"
}
Is this ok? (yes) yes
Then i have packaje.json:
diego.martin#csa-188:~/Proyectos/pruebas/prueba$ ls -la
total 12
drwxrwxr-x 2 diego.martin diego.martin 4096 jul 5 13:30 .
drwxr-xr-x 11 diego.martin diego.martin 4096 jul 5 13:25 ..
-rw-rw-r-- 1 diego.martin diego.martin 210 jul 5 13:30 package.json
diego.martin#csa-188:~/Proyectos/pruebas/prueba$
Lastest:
diego.martin#csa-188:~/Proyectos/pruebas/prueba$ npm install mysql --save
hello#1.0.0 /home/diego.martin/Proyectos/pruebas/prueba
└─┬ mysql#2.13.0
├── bignumber.js#3.1.2
├─┬ readable-stream#1.1.14
│ ├── core-util-is#1.0.2
│ ├── inherits#2.0.3
│ ├── isarray#0.0.1
│ └── string_decoder#0.10.31
└── sqlstring#2.2.0
npm WARN hello#1.0.0 No repository field.
diego.martin#csa-188:~/Proyectos/pruebas/prueba$
I am trying to use an eslint workflow. I have installed Node via nvm and the nessary plugins globally:
├── babel-eslint#6.0.2
├── eslint#2.7.0
├── eslint-config-angular#0.5.0
├── eslint-config-semistandard#6.0.1
├── eslint-config-standard#5.1.0
├── eslint-plugin-angular#1.0.0
├── eslint-plugin-promise#1.1.0
├── eslint-plugin-standard#1.3.2
├── npm#3.8.3
├── standard#6.0.8
And locally in my project:
"devDependencies": {
"eslint": "2.7.0",
"eslint-config-angular": "0.5.0",
"eslint-config-standard": "5.1.0",
"eslint-config-semistandard": "6.0.1",
"eslint-plugin-angular": "1.0.0",
"eslint-plugin-promise": "1.1.0",
"eslint-plugin-standard": "1.3.2"
},
And I have set up an .eslintrc.json file in my project root:
{
"env": {
"browser": 1
},
"extends": "semistandard",
"plugins": [
"standard","angular"
],
"globals": {
"angular": 1,
"$": 1,
"angularDragula": 1
}
}
The Atom ESlint and standard-formatter plugins find and respect my config file, but it not the command line or the Sublime Linter. It does not read the config, so I get errors flagged:
Which make it obvious it's not reading the settings. What am I doing wrong here? As I said, it works in Atom but not command line or Sublime (which uses the command-line options).
I'd recommend against using a global installation of ESLint. If you want to run it to lint the files in your project, you can use:
node_modules/.bin/eslint feedback-alerts.controller.js
Or, better yet, create an npm script for the task. In your package.json, you can add:
"scripts": {
"lint": "eslint feedback-alerts.controller.js"
}
Furthermore, it looks like you are using a config file that is not in your project root (~/.eslintrc.json is in your user root, not project root). ESLint will do its own config resolution, so you should not have to specify the path to the config file except in advanced cases.