I currently have a directory myproject/
In myproject I have these
/src
/public
package.json
etc.
Normal stuff you'd see in a react app.
I pushed this to a server aws lightsail nodejs
I then run npm install.
After I do all this I go and run npm run build
I get this output:
> react-scripts build
Creating an optimized production build...
Failed to compile.
./src/index.js
Cannot find module: 'layouts/Admin.jsx'. Make sure this package is installed.
You can install this package by running: npm install layouts/Admin.jsx.
The files it's calling for are in the directory.
Here is package.json
{
"name": "argon-dashboard-react",
"version": "1.0.0",
"description": "React version of Argon Dashboard by Creative Tim",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/creativetimofficial/argon-dashboard-react.git"
},
"keywords": [
"react",
"reactjs",
"argon",
"argon-react",
"dashboard",
"dashboard-react",
"argon-dashboard",
"argon-dashboard-react"
],
"author": "Creative Tim",
"license": "MIT",
"bugs": {
"url": "https://github.com/creativetimofficial/argon-dashboard-react/issues"
},
"homepage": "https://demos.creative-tim.com/argon-dashboard-react/",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"compile-sass": "node-sass src/assets/scss/argon-dashboard-react.scss src/assets/css/argon-dashboard-react.css",
"minify-sass": "node-sass src/assets/scss/argon-dashboard-react.scss src/assets/css/argon-dashboard-react.min.css --output-style compressed",
"map-sass": "node-sass src/assets/scss/argon-dashboard-react.scss src/assets/css/argon-dashboard-react.css --source-map true"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"dependencies": {
"#material-ui/core": "^4.6.1",
"#material-ui/icons": "^4.5.1",
"chart.js": "2.7.3",
"classnames": "2.2.6",
"firebase": "^6.6.2",
"firebase-admin": "^8.8.0",
"http2": "^3.3.7",
"moment": "2.24.0",
"node-sass": "4.11.0",
"nouislider": "13.1.1",
"react": "16.9.0",
"react-bootstrap-table-next": "^3.2.1",
"react-chartjs-2": "2.7.4",
"react-copy-to-clipboard": "5.0.1",
"react-data-table-component": "4.0.1",
"react-datepicker": "^2.9.6",
"react-datetime": "2.16.3",
"react-dom": "16.9.0",
"react-google-maps": "9.4.5",
"react-loading-screen": "0.0.17",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.8",
"reactstrap": "7.1.0",
"recompose": "^0.30.0",
"styled-components": "^4.4.1",
"sweetalert2": "^9.5.4",
"sweetalert2-react-content": "^2.0.2"
},
"devDependencies": {
"#types/googlemaps": "3.30.18",
"#types/markerclustererplus": "2.1.33",
"#types/react": "16.8.7",
"typescript": "3.3.3333"
}
}
Any idea what's going on with this?
The problem was related to the way I was using my import paths for components.
In example, currently I have:
import UserHeader from "components/Headers/UserHeader.jsx";
The correct way to have set them was:
import UserHeader from "../../components/Headers/UserHeader.jsx";
What was throwing me off was that locally it worked.
Related
I am creating a dependancy to generate PDF on nestjs, to do it I am using puppeteer.
When I try to use puppeteer inside the dependancy I get an error:
Error: Run `npm install` to download the correct Chromium revision (1056772).
But when I do it from the project and not the dependancy there is no error. It only happen when I use puppeteer from the dependancy, but it's launched from the same project.
First I generated the PDF inside a nestjs project and it worked fine.
Then I moved the code to my library inside a service but then there is the error.
I tried to run the following command to install chromium
node node_modules/puppeteer/install.js
But nothing change and here is the result of the command:
Chromium is already in C:\Users\Greg.cache\puppeteer\chrome\win64-1069273; skipping download.
I also tried to delete the node modules and reinstall it but no change.
The package.json of the dependancy:
{
"name": "#gboutte/nestjs-pdf",
"version": "0.0.3",
"description": "This package provide a service to render PDF from html string or from handlebars tempaltes for nestjs.",
"keywords": [
"nestjs",
"handlebars",
"hbs",
"templates",
"pdf"
],
"homepage": "https://github.com/gboutte/nestjs-pdf#readme",
"bugs": {
"url": "https://github.com/gboutte/nestjs-pdf/issues",
"email": "gboutte#protonmail.com"
},
"repository": {
"type": "git",
"url": "https://github.com/gboutte/nestjs-pdf"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rimraf dist && tsc",
"prepublish": "npm run build"
},
"author": "Grégory Boutte <gboutte#protonmail.com>",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"#nestjs/common": "^9.1.6",
"#gboutte/nestjs-hbs": "^0.0.3",
"#types/node": "^18.11.5",
"puppeteer": "^19.1.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.7",
"typescript": "^4.8.4"
},
"peerDependencies": {
"#nestjs/common": "^9.1.6",
"#gboutte/nestjs-hbs": "^0.0.3",
"#types/node": "^18.11.5",
"puppeteer": "^19.1.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.7",
"typescript": "^4.8.4"
}
}
And the package.json of the main project
{
"name": "nestjs-hbs-demo",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"main": "dist/index.js",
"readmeFilename": "README.md",
"files": [
"dist/**/*",
"*.md"
],
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"#gboutte/nestjs-hbs": "file:../nestjs-hbs",
"#gboutte/nestjs-pdf": "file:../nestjs-pdf",
"#nestjs/common": "^9.0.0",
"#nestjs/core": "^9.0.0",
"#nestjs/platform-express": "^9.0.0",
"#nestjs/platform-fastify": "^9.1.6",
"puppeteer": "^19.4.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
},
"devDependencies": {
"#nestjs/cli": "^9.0.0",
"#nestjs/schematics": "^9.0.0",
"#nestjs/testing": "^9.0.0",
"#types/express": "^4.17.13",
"#types/jest": "28.1.8",
"#types/node": "^16.0.0",
"#types/supertest": "^2.0.11",
"#typescript-eslint/eslint-plugin": "^5.0.0",
"#typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "28.1.3",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.8",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.1.0",
"typescript": "^4.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
I resolved the issue by updating my local nodejs and I changed the #types/node dependency of both project to be the same.
"#types/node": "^18.0.0",
I found out that it was this problem by trying to install the library with github instead of locally.
Before I used npm install ../directory-to-my-lib, then I used npm install <url to the github repo>.
The difference is that using github npm gave me an error saying that both version of #types/node were different, I don't know why I did not have this error using the other command.
Now that I fixed the version it works with all installation methods (npm package / github / locally).
I get this error when I try to deploy to Heroku :
[eslint] Failed to load config "airbnb" to extend from.
remote: Referenced from: /tmp/build_b7392388/client/.eslintrc.json
I have a client-server architecture that looks like this:
And in detail it looks like this:
Client part contains .eslintrc.json but the server part (root folder) does not.
Here is package.json from server (root folder):
{
"proxy": "http://localhost:3001",
"name": "emoteco_nodejs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"homepage": ".",
"scripts": {
"start": "node server/index.js",
"build": "cd client && npm install && npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines": {
"node": "14.17.5"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"applicationinsights": "^2.3.0",
"axios": "^0.27.2",
"azure-storage": "^2.10.7",
"express": "^4.17.2",
"gm": "^1.23.1",
"image-data-uri": "^2.0.1",
"jsonwebtoken": "^8.5.1",
"mongodb": "^4.2.2",
"multer": "^1.4.5-lts.1",
"node-cron": "^3.0.0",
"node-html-to-image": "^3.2.4",
"nodemailer": "^6.7.7",
"react-validation": "^3.0.7",
"validator": "^13.7.0"
},
"devDependencies": {
"sass": "^1.52.1"
}
}
Here is package.json from client (sub folder):
{
"name": "emotecoapp",
"version": "2.0.1",
"private": true,
"author": "Creative Tim",
"license": "See license in https://www.creative-tim.com/license",
"description": "Otis Kit PRO by Creative Tim",
"homepage": "",
"bugs": {
"url": "https://github.com/creativetimofficial/ct-otis-kit-pro/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/creativetimofficial/ct-otis-kit-pro.git"
},
"engines": {
"node": "14 || 15 || 16",
"npm": ">=6"
},
"dependencies": {
"#emotion/cache": "11.7.1",
"#emotion/react": "11.9.0",
"#emotion/styled": "11.8.1",
"#mui/icons-material": "5.6.2",
"#mui/material": "5.6.4",
"#mui/styled-engine": "5.6.1",
"#testing-library/jest-dom": "5.16.4",
"#testing-library/react": "13.2.0",
"#testing-library/user-event": "14.1.1",
"#types/jest": "^29.2.0",
"#types/node": "^18.11.7",
"#types/react": "^18.0.24",
"#types/react-dom": "^18.0.8",
"axios": "^1.1.3",
"chroma-js": "2.4.2",
"flatpickr": "4.6.13",
"onnxjs": "^0.1.8",
"prop-types": "15.8.1",
"react": "18.1.0",
"react-copy-to-clipboard": "5.1.0",
"react-countup": "6.2.0",
"react-dom": "18.1.0",
"react-flatpickr": "3.10.11",
"react-native-pytorch-core": "^0.2.2",
"react-router-dom": "6.3.0",
"react-scripts": "5.0.1",
"react-syntax-highlighter": "15.5.0",
"react-webcam": "^7.0.1",
"rellax": "1.12.1",
"swiper": "7.3.4",
"typed.js": "2.0.12",
"typescript": "^4.8.4",
"uuid": "8.3.2",
"web-vitals": "2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.5.0",
"prettier": "2.6.2"
}
}
I have tried several solutions like:
1.
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
install-peerdeps --dev eslint-config-airbnb-base
It didn't work.
2.
I also tried to change the setting.json of the VScode workspace like this:
{
"eslint.workingDirectories": [
"./client"
]
}
It didn't work as well
I have tried most of suggested solutions on internet but nothing works on my case.
Do you have any idea how I can solve my issue?
Hi I am developing an Electron-react app using create-react-app boilerplate and electron-builder to package and deploy it.
However, on running electron-builder using yarn in the CL it shows this error.
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
• writing effective config file=build\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=8.0.1 appOutDir=build\win-unpacked
• default Electron icon is used reason=application icon is not set
• building target=nsis file=build\electron-react-typescript-app Setup 0.1.0.exe archs=x64 oneClick=true perMachine=false
⨯ write EPIPE stackTrace=
Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:150:25)
at writeGeneric (internal/stream_base_commons.js:141:3)
at Socket._writeGeneric (net.js:771:11)
at Socket._write (net.js:783:8)
at doWrite (_stream_writable.js:431:12)
at writeOrBuffer (_stream_writable.js:415:5)
at Socket.Writable.write (_stream_writable.js:305:11)
at Socket.Writable.end (_stream_writable.js:594:10)
at Socket.end (net.js:575:31)
at C:\Users\andrew.choi\Documents\electron-react-app\.yarn\cache\builder-util-npm-22.3.3-d8bf259145-2.zip\node_modules\builder-util\src\util.ts:193:26
at new Promise (<anonymous>)
at spawnAndWrite (C:\Users\username\Documents\electron-react-app\.yarn\cache\builder-util-npm-22.3.3-d8bf259145-2.zip\node_modules\builder-util\src\util.ts:176:10)
at NsisTarget.executeMakensis (C:\Users\username\Documents\electron-react-app\.yarn\cache\app-builder-lib-npm-22.3.3-dc71ab7fc0-2.zip\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:552:11)
at NsisTarget.computeScriptAndSignUninstaller (C:\Users\andrew.choi\Documents\electron-react-app\.yarn\cache\app-builder-lib-npm-22.3.3-dc71ab7fc0-2.zip\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:340:5)
at NsisTarget.buildInstaller (C:\Users\username\Documents\electron-react-app\.yarn\cache\app-builder-lib-npm-22.3.3-dc71ab7fc0-2.zip\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:278:103)
at NsisTarget.finishBuild (C:\Users\username\Documents\electron-react-app\.yarn\cache\app-builder-lib-npm-22.3.3-dc71ab7fc0-2.zip\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:110:7)
command not found: electron-builder
Here is my package.json file.
I am using windows 10 if that matters.
And running "yarn dist" in the command prompt opened with administrators permissions
{
"name": "electron-react-typescript-app",
"version": "0.1.0",
"private": true,
"main": "src/start.js",
"build": {
"appId": "123456789",
"directories": {
"buildResources": "assets",
"output": "build"
},
"win": {
"target": "nsis"
}
},
"dependencies": {
"#material-ui/core": "^4.8.0",
"#material-ui/icons": "^4.5.1",
"#reduxjs/toolkit": "^1.2.3",
"axios": "^0.19.2",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"electron-is-dev": "^1.1.0",
"electron-updater": "^4.2.0",
"express": "^4.17.1",
"immer": "^5.3.2",
"material-table": "^1.55.0",
"mssql": "^6.0.1",
"react": "^16.10.2",
"react-desktop": "^0.3.9",
"react-dom": "^16.10.2",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"tailwindcss": "^1.2.0"
},
"scripts": {
"electron": "cross-env NODE_ENV=dev nodemon --exec \"\"electron .\"\"",
"electron-build": "electron-builder",
"start": "cross-env BROWSER=none nodemon npm run react-start",
"react-start": "react-scripts start",
"build": "react-scripts build",
"react-test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"server": "node ./server/server --exec nodemon | pino-colada",
"dev": "run-p server react-start",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"proxy": "http://localhost:3500",
"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"
]
},
"devDependencies": {
"cross-env": "^6.0.3",
"devtron": "^1.4.0",
"electron": "8.0.1",
"electron-builder": "^22.3.2",
"electron-devtools-installer": "^2.2.4",
"electron-redux-devtools": "^0.3.4",
"electron-reload": "^1.5.0",
"express-pino-logger": "^4.0.0",
"node-env-run": "^3.0.2",
"nodemon": "^1.19.3",
"npm-run-all": "^4.1.5",
"pino-colada": "^1.5.1",
"redux-devtools-extension": "^2.13.8"
},
"description": "An Electron React App",
"repository": {
"type": "git",
"url": "git+https://github.com/Icecubelegacy/Electron-react-app.git"
},
"keywords": [
"electron"
],
"author": "Andrew Choi",
"license": "ISC",
"bugs": {
"url": "https://github.com/Icecubelegacy/Electron-react-app/issues"
},
"homepage": "./",
"postinstall": "electron-builder intall-app-deps"
}
command not found: electron-builder
This likely means that your node_modules folder doesn't have electron-builder under node_modules/.bin.
You can try running the command
yarn
which should get you electron-builder installed locally since it's listed under your devDependencies in your package.json file.
This issue has now been resolved.
I started a new project, specified the version of electron-builder as 22.3.5, ran yarn build and then ran yarn electron-pack. Then I went to my .dist folder and installed the setup exe and then was able to open the .exe application file successfully.
While trying to fix a material-ui component "Popper" error saying it can't find it's module, i did a few npm commands:
npm install react-popper#next --save
npm install avj
npm install --save-dev webpack
npm install & npm update
After this i couldnt make the project compile again; I tried deleting node_modules then npm install, and i also installed the webpack-cli module.
Terminal
package.json
{
"name": "auto-club-reviews",
"description": "Auto Club Reviews Blog",
"version": "1.0.0",
"author": "Sofianu Alin",
"dependencies": {
"#material-ui/core": "^1.4.3",
"#material-ui/icons": "^1.1.0",
"gatsby": "^1.9.277",
"gatsby-link": "^1.6.46",
"gatsby-plugin-feed": "^1.3.25",
"gatsby-plugin-google-analytics": "^1.0.31",
"gatsby-plugin-offline": "^1.0.18",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-plugin-react-next": "^1.0.11",
"gatsby-plugin-sharp": "^1.6.48",
"gatsby-plugin-typography": "^1.7.19",
"gatsby-remark-copy-linked-files": "^1.5.37",
"gatsby-remark-images": "^1.5.67",
"gatsby-remark-responsive-iframe": "^1.4.20",
"gatsby-remark-smartypants": "^1.4.12",
"gatsby-source-contentful": "^1.3.54",
"gatsby-source-filesystem": "^1.5.39",
"gatsby-transformer-remark": "^1.7.44",
"gatsby-transformer-sharp": "^1.6.27",
"lodash": "^4.17.10",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-helmet": "^5.2.0",
"react-hover": "^1.3.2",
"react-popper": "^1.0.2",
"typeface-roboto": "0.0.54",
"typography-theme-alton": "^0.15.10",
"typography-theme-lincoln": "^0.15.11",
"typography-theme-wordpress-2016": "^0.15.10",
"webpack-command": "^0.4.1"
},
"devDependencies": {
"eslint": "^5.3.0",
"eslint-plugin-react": "^7.10.0",
"gh-pages": "^1.2.0",
"html-webpack-plugin": "^3.2.0",
"prettier": "^1.14.2",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0",
"webpack-dev-middleware": "^3.1.3",
"webpack-dev-server": "^3.1.5"
},
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"repository": {
"type": "git",
"url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
},
"scripts": {
"dev": "gatsby develop",
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'",
"develop": "gatsby develop",
"build": "gatsby build",
"deploy": "gatsby build --prefix-paths && gh-pages -d public",
"fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js"
}
}
Any ideas whats happening anyone?
I'm a newbie nodejs. I have a trouble about deploying nodejs app to google app engine. This is my error, I have been trying to fix it but it's not work. I've installed babel.
Bug
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
restaurant_api#1.0.0 prestart /app
npm run -s build
You have mistakenly installed the babel package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the babel package to the babel-cli package.
npm uninstall babel
npm install --save-dev babel-cli
This is my package.json
"main": "dist",
"scripts": {
"dev": "NODE_ENV=development nodemon -w src --exec \"babel-node src --presets es2015,stage-0\"",
"build": "babel src -s -D -d dist --presets es2015,stage-0",
"start": "NODE_ENV=production pm2 start dist",
"prestart": "npm run -s build",
"lint": "eslint src",
"test": "echo \"Error: no test specified\" && exit 1",
"babel-version": "babel --version"
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"env": {
"node": true
},
"rules": {
"no-console": 0,
"no-unused-vars": 1
}
},
"author": "",
"license": "ISC",
"dependencies": {
"babel": "^6.23.0",
"body-parser": "^1.17.0",
"express": "^4.15.0",
"express-jwt": "^5.1.0",
"jsonwebtoken": "^7.3.0",
"mongoose": "^4.8.5",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^4.0.0",
"pm2": "^2.4.2"
},
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-eslint": "^7.1.1",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"eslint": "^3.16.1"
}
Problem is quite simple, if you notice clearly GAE, does not install dev-dependencies. So move your dev-deps above inside deps , like I did and babel no found error is gone.
{
"name": "scraping",
"version": "0.3.0",
"description": "Starter project for an ES6 RESTful Express API",
"main": "dist",
"scripts": {
"dev": "nodemon -w src --exec \"babel-node src --presets es2015,stage-0\"",
"build": "babel src -s -D -d dist --presets es2015,stage-0",
"start": "node dist",
"prestart": "npm run -s build",
"test": "eslint src"
},
"eslintConfig": {
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"env": {
"node": true
},
"rules": {
"no-console": 0,
"no-unused-vars": 1
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/developit/express-es6-rest-api.git"
},
"author": "Saransh Sharma <jason#developit.ca>",
"license": "MIT",
"dependencies": {
"body-parser": "^1.13.3",
"compression": "^1.5.2",
"cors": "^2.7.1",
"express": "^4.13.3",
"morgan": "^1.8.0",
"resource-router-middleware": "^0.6.0",
"#jonstuebe/scraper": "^0.1.4",
"babel-cli": "^6.9.0",
"babel-core": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-0": "^6.5.0",
"eslint": "^3.1.1",
"nodemon": "^1.9.2"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-0": "^6.5.0",
"eslint": "^3.1.1",
"nodemon": "^1.9.2"
},
"bugs": {
"url": "https://github.com/developit/express-es6-rest-api/issues"
},
"homepage": "https://github.com/developit/express-es6-rest-api#readme",
"keywords": [
"scraper",
"product",
"from",
"amazon"
]
}
The clue is in the error message.
In your devDependencies section, you already have babel-cli included.
However, your dependencies section still has a reference to "babel": "^6.23.0".
Either remove this line, or replace it with babel-cli, leaving you with:
"dependencies": {
"babel-cli": "^6.23.0",
"body-parser": "^1.17.0",
"express": "^4.15.0",
"express-jwt": "^5.1.0",
"jsonwebtoken": "^7.3.0",
"mongoose": "^4.8.5",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^4.0.0",
"pm2": "^2.4.2"
},
You need to install babel-cli globally, i.e. run the command "npm install babel-cli -g" as part of your build npm script, or create a pre-install script that install it if you want to keep it more organized in case you need to add more things later on.
"scripts": {
"dev": "NODE_ENV=development nodemon -w src --exec \"babel-node src --presets es2015,stage-0\"",
"build": "npm install bable-cli -g && babel src -s -D -d dist --presets es2015,stage-0",