NodeJS start ERROR in ./app/app.jsx Module build failed: ReferenceError: [BABEL] - node.js

I am .net developer.Previous developer used nodeJS and react for one project.I must complete that project.That project use nodeJS,and reactJS.I installed NodeJS in windows 8
I install packages(npm install) it worked well.But now I try to run start project(npm start) but it give error about babel.
C:\rc>npm start
> react-seed#0.0.13 prestart C:\rc
> npm install
npm WARN package.json react-seed#0.0.13 No license field.
> node-sass#3.4.2 install C:\rc\node_modules\node-sass
> node scripts/install.js
> node-sass#3.4.2 postinstall C:\rc\node_modules\node-sass
> node scripts/build.js
` C:\rc\node_modules\node-sass\vendor\win32-x64-46\binding.node ` exists.
testing binary.
Binary is fine; exiting.
npm WARN unmet dependency C:\rc\node_modules\rimraf requires glob#'^7.0.0' but w
ill load
npm WARN unmet dependency C:\rc\node_modules\glob,
npm WARN unmet dependency which is version 5.0.15
npm WARN unmet dependency C:\rc\node_modules\babel-plugin-transform-decorators-l
egacy requires babel-runtime#'^6.2.0' but will load
npm WARN unmet dependency C:\rc\node_modules\babel-runtime,
npm WARN unmet dependency which is version 5.8.38
npm WARN unmet dependency C:\rc\node_modules\babel-preset-es2015\node_modules\ba
bel-plugin-transform-regenerator requires babel-core#'^6.6.5' but will load
npm WARN unmet dependency C:\rc\node_modules\babel-core,
npm WARN unmet dependency which is version 5.8.38
npm WARN unmet dependency C:\rc\node_modules\karma-mocha-reporter\node_modules\k
arma requires glob#'^7.0.0' but will load
npm WARN unmet dependency C:\rc\node_modules\glob,
npm WARN unmet dependency which is version 5.0.15
> react-seed#0.0.13 start C:\rc
> set NODE_ENV=development && node dev-server ./webpack/config
Listening at http://0.0.0.0:8000
Hash: dfc04e15fb6c36f0d4eb
Version: webpack 1.12.14
Time: 812ms
Asset Size Chunks Chunk Names
vendor.bundle.js 839 bytes 0 vendor
js\app.0.0.13.js 102 bytes 1 app
chunk {0} vendor.bundle.js (vendor) 28 bytes [rendered]
[0] multi vendor 28 bytes {0} [built] [1 error]
chunk {1} js\app.0.0.13.js (app) 28 bytes {0} [rendered]
[0] multi app 28 bytes {1} [built] [1 error]
ERROR in ./app/app.jsx
Module build failed: ReferenceError: [BABEL] C:\rc\app\app.jsx: Unknown option:
direct.presets
at Logger.error (C:\rc\node_modules\babel-core\lib\transformation\file\logge
r.js:58:11)
at OptionManager.mergeOptions (C:\rc\node_modules\babel-core\lib\transformat
ion\file\options\option-manager.js:126:29)
at OptionManager.init (C:\rc\node_modules\babel-core\lib\transformation\file
\options\option-manager.js:216:10)
at File.initOptions (C:\rc\node_modules\babel-core\lib\transformation\file\i
ndex.js:147:75)
at new File (C:\rc\node_modules\babel-core\lib\transformation\file\index.js:
137:22)
at Pipeline.transform (C:\rc\node_modules\babel-core\lib\transformation\pipe
line.js:164:16)
at transpile (C:\rc\node_modules\babel-loader\index.js:12:22)
at Object.module.exports (C:\rc\node_modules\babel-loader\index.js:71:12)
# multi app
ERROR in ./app/vendor.js
Module build failed: ReferenceError: [BABEL] C:\rc\app\vendor.js: Unknown option
: direct.presets
at Logger.error (C:\rc\node_modules\babel-core\lib\transformation\file\logge
r.js:58:11)
at OptionManager.mergeOptions (C:\rc\node_modules\babel-core\lib\transformat
ion\file\options\option-manager.js:126:29)
at OptionManager.init (C:\rc\node_modules\babel-core\lib\transformation\file
\options\option-manager.js:216:10)
at File.initOptions (C:\rc\node_modules\babel-core\lib\transformation\file\i
ndex.js:147:75)
at new File (C:\rc\node_modules\babel-core\lib\transformation\file\index.js:
137:22)
at Pipeline.transform (C:\rc\node_modules\babel-core\lib\transformation\pipe
line.js:164:16)
at transpile (C:\rc\node_modules\babel-loader\index.js:12:22)
at Object.module.exports (C:\rc\node_modules\babel-loader\index.js:71:12)
# multi vendor
webpack: bundle is now VALID.
Here is my package.json
{
"name": "react-seed",
"version": "0.0.13",
"description": "Seed project for React apps using ES6 & webpack.",
"repository": "https://github.com/badsyntax/react-seed",
"config": {
"buildDir": "./build",
"buildDirTests": "./build_tests",
"devHost": "0.0.0.0",
"devPort": 8000,
"remoteHost": "https://mokey.gear.host"
},
"scripts": {
"build": "NODE_ENV=production npm run webpack",
"clean": "rimraf $npm_package_config_buildDir && mkdir $npm_package_config_buildDir",
"env": "env",
"lint": "eslint --ext .js --ext .jsx ./app ./webpack && echo No linting errors.",
"prebuild": "npm run clean",
"prestart": "npm install",
"pretest": "npm install && npm run lint",
"pretest-travis": "npm install && npm run lint",
"start": "set NODE_ENV=development && node dev-server ./webpack/config",
"test": "NODE_ENV=test karma start --single-run",
"test-dev": "NODE_ENV=test karma start",
"test-travis": "NODE_ENV=test karma start --single-run",
"webpack": "webpack --colors --progress --config ./webpack/config"
},
"dependencies": {
"classnames": "^2.1.1",
"hammerjs": "^2.0.4",
"immutable": "^3.7.6",
"intl": "^1.0.0",
"intl-locales-supported": "^1.0.0",
"jquery": "^2.1.4",
"lodash": "^4.6.1",
"materialize-css": "^0.97.5",
"ms-signalr-client": "^2.2.2",
"normalize.css": "^3.0.3",
"react": "^0.14.7",
"react-dnd": "^2.1.3",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^0.14.7",
"react-flexgrid": "^0.7.0",
"react-intl": "^2.0.0-rc-1",
"react-redux": "^4.4.1",
"redux": "^3.3.1",
"redux-thunk": "^2.0.1",
"superagent": "^1.3.0"
},
"devDependencies": {
"autoprefixer-core": "^5.1.11",
"babel-core": "^5.3.3",
"babel-eslint": "^3.1.23",
"babel-loader": "^5.0.0",
"babel-plugin-rewire": "^0.1.8",
"babel-preset-react": "^6.5.0",
"babel-runtime": "^5.3.3",
"chai": "^2.3.0",
"compass-mixins": "^0.12.7",
"css-loader": "^0.12.1",
"eslint": "^0.21.0",
"eslint-plugin-react": "^2.3.0",
"expose-loader": "^0.7.0",
"extract-text-webpack-plugin": "^0.8.0",
"file-loader": "^0.8.1",
"glob": "^5.0.6",
"html-loader": "^0.3.0",
"json-loader": "^0.5.1",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.12",
"karma-cli": "0.0.4",
"karma-mocha": "^0.1.10",
"karma-mocha-reporter": "^1.0.2",
"karma-phantomjs-launcher": "^0.1.4",
"karma-sinon": "^1.0.4",
"karma-source-map-support": "^1.0.0",
"karma-sourcemap-loader": "^0.3.4",
"karma-webpack": "^1.5.1",
"mocha": "^2.2.4",
"mocha-loader": "^0.7.1",
"node-libs-browser": "^0.5.0",
"opn": "^1.0.2",
"postcss-loader": "^0.4.3",
"react-hot-loader": "^1.2.7",
"rimraf": "^2.3.3",
"sass-loader": "^0.4.2",
"sinon": "^1.14.1",
"source-map-support": "^0.2.10",
"style-loader": "^0.12.2",
"template-html-loader": "0.0.3",
"webpack": "^1.9.5",
"webpack-dev-server": "^1.8.2"
},
"engines": {
"node": ">=0.10.0"
},
"eslintConfig": {
"env": {
"browser": true,
"node": true,
"es6": true
},
"ecmaFeatures": {
"modules": true,
"jsx": true
},
"globals": {
"describe": true,
"it": true,
"xit": true,
"xdescribe": true,
"beforeEach": true,
"sinon": true
},
"plugins": [
"react"
],
"parser": "babel-eslint",
"rules": {
"strict": true,
"indent": [
2,
2
],
"quotes": [
2,
"single"
],
"new-cap": 0,
"no-unused-expressions": 0,
"no-underscore-dangle": 0,
"react/display-name": 0,
"react/jsx-quotes": 1,
"react/jsx-no-undef": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/no-unknown-property": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1
}
}
}

Sounds like you have configuration for Babel v6 (e.g. presets option) somewhere (.babelrc?) but you're using Babel v5.

Related

Unmet peer dependency after fresh install and deletion of both node_modules and package.json

NPM seems to either not be recognizing or not be installing the packages listed in my package.json. I keep getting warnings which are preventing my build from passing which is a large issue. specifically:
npm WARN react-datepicker#0.49.0 requires a peer of react#^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-datepicker#0.49.0 requires a peer of react-dom#^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-modal#2.4.1 requires a peer of react#^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-modal#2.4.1 requires a peer of react-dom#^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
This warning is confusing for me considering my react dependency is 16.5.0, well beyond ^14.0 or ^15.0. Everything I have looked up has said to delete node_modules and package.json.lock then run npm install but this does not seem to solve the problem or change anything really. Any help would be much appreciated.
here is a copy of my package.json
{
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3001",
"devDependencies": {
"axios-mock-adapter": "^1.13.1",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"husky": "^0.13.4",
"lint-staged": "^3.6.1",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.0.2",
"prettier": "^1.10.2",
"react-scripts": "^1.1.4",
"react-test-renderer": "^16.0.0",
"redux-mock-store": "^1.5.1",
"redux-testkit": "^1.0.6"
},
"dependencies": {
"axios": "^0.16.2",
"babel-polyfill": "^6.26.0",
"big.js": "^5.0.3",
"class-names": "^1.0.0",
"create-app": "^0.6.0",
"d3": "^5.5.0",
"d3-array": "^1.2.1",
"d3-scale": "^1.0.6",
"debounce": "^1.0.2",
"font-awesome": "^4.7.0",
"jest-enzyme": "^4.0.1",
"leaflet": "^1.0.3",
"lodash": "^4.17.10",
"lodash.throttle": "^4.1.1",
"mixpanel-browser": "^2.13.0",
"moment": "^2.18.1",
"mousetrap": "^1.6.1",
"numeral": "^2.0.6",
"polyline-encoded": "^0.0.8",
"prop-types": "^15.5.10",
"query-string": "^5.0.0",
"raven-js": "^3.17.0",
"rc-trigger": "^1.11.2",
"react": "^16.5.0",
"react-bootstrap": "^0.32.0",
"react-countup": "^2.1.1",
"react-custom-scrollbars": "^4.1.2",
"react-datepicker": "^0.49.0",
"react-dom": "^16.5.0",
"react-fontawesome": "^1.6.1",
"react-gravatar": "^2.6.3",
"react-leaflet": "^1.3.0",
"react-list": "^0.8.6",
"react-markdown": "^2.5.1",
"react-modal": "^2.3.2",
"react-redux": "^5.0.5",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-slider": "^0.8.0",
"react-sortable-hoc": "^0.6.5",
"react-transition-group": "1.x",
"redux": "^3.6.0",
"redux-form": "^7.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"reselect": "^3.0.1",
"yarn": "^1.3.2"
},
"scripts": {
"build": "yarn run build-css && react-scripts build",
"build-css": "npm rebuild node-sass && node-sass-chokidar --include-path ./src --include-path ./node_modules ./src/ -o ./src/",
"deploy": "./deploy.sh",
"eject": "react-scripts eject",
"precommit": "lint-staged",
"start": "npm-run-all -p watch-css start-js",
"start-js": "react-scripts start",
"test": "react-scripts test --env=jsdom",
"watch-css": "yarn run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules ./src/ -o ./src/ --watch --recursive"
},
"lint-staged": {
"*.js": [
"prettier --single-quote --write",
"git add",
"prettier --write"
]
}
}
This warning is confusing for me considering my react dependency is 16.5.0, well beyond ^14.0 or ^15.0.
^15.0.0 means anything from 15.0.0 up to (but not including) 16.0.0.
So 16.5.0 is actually too new.

MEAN NPM Cannot find module 'webpack/lib/optimize/CommonsChunkPlugin' Error

I am having a little bit of problem upgrading to latest webpack. I have already checked the following threads and found that the cause of the error is a deprecated class.
Webpack migration 3 -> 4: Error: Cannot find module 'webpack/lib/optimize/CommonsChunkPlugin'
Webpack 4 migration CommonsChunkPlugin
The only problem is that I am not using this class in my code but even though I updated it, webpack itself is referencing it somewhere.
Note: I have already tried removing the node_modules, clearing cache and reinstalling
I generated the package.json through MEAN and the start script that is in the package.json use is referencing a bunch of webpack scripts which might be the issue.
One thing that is interesting is the following warning, tho, I am not sure if it is related:
preload-webpack-plugin#2.3.0 requires a peer of webpack#^3.2.0 but none is installed. You must install peer dependencies yourself.
It is saying a version higher then 3.2.0 is required (I have 4.2.0). I am not sure if it is because it is not recognizing the WebpackV4 or if V4 is just not backward compatible
current node version: 9.8.0
I appreciate any ideas/suggestions. package.json and the full error is below. Please let me know if I can provide any further info
[0] > Mean#2.0.1 server:dev /Users/Sinan/Desktop/cllctroffcl
[0] > npm run webpack-dev-server -- --config config/webpack.dev.js --open --
progress --profile --watch --content-base src/
[0]
[0]
[0] > Mean#2.0.1 webpack-dev-server /Users/Sinan/Desktop/cllctroffcl
[0] > node --max_old_space_size=4096 node_modules/webpack-dev-
server/bin/webpack-dev-server.js "--config" "config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--content-base" "src/"
[0]
[1] PC listening on 8888
[0] module.js:545
[0] throw err;
[0] ^
[0]
[0] Error: Cannot find module 'webpack/lib/optimize/CommonsChunkPlugin'
[0] at Function.Module._resolveFilename (module.js:543:15)
[0] at Function.Module._load (module.js:470:25)
[0] at Module.require (module.js:593:17)
[0] at require (internal/module.js:11:18)
[0] at Object.<anonymous>
(/Users/Sinan/Desktop/cllctroffcl/config/webpack.common.js:16:28)
[0] at Module._compile (module.js:649:30)
[0] at Object.Module._extensions..js (module.js:660:10)
[0] at Module.load (module.js:561:32)
[0] at tryModuleLoad (module.js:501:12)
[0] at Function.Module._load (module.js:493:3)
[0] npm ERR! code ELIFECYCLE
[0] npm ERR! errno 1
[0] npm ERR! Mean#2.0.1 webpack-dev-server: `node --max_old_space_size=4096
node_modules/webpack-dev-server/bin/webpack-dev-server.js "--config"
"config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--
content-base" "src/"`
[0] npm ERR! Exit status 1
[0] npm ERR!
npm ERR! Failed at the Mean#2.0.1 webpack-dev-server script.
[0] npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
[0]
[0] npm ERR! A complete log of this run can be found in:
[0] npm ERR! /Users/Sinan/.npm/_logs/2018-03-26T03_43_37_514Z-debug.log
[0] npm ERR! code ELIFECYCLE
[0] npm ERR! errno 1
[0] npm ERR! Mean#2.0.1 server:dev: `npm run webpack-dev-server -- --config
config/webpack.dev.js --open --progress --profile --watch --content-base
src/`
[0] npm ERR! Exit status 1
[0] npm ERR!
[0] npm ERR! Failed at the Mean#2.0.1 server:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
[0]
[0] npm ERR! A complete log of this run can be found in:
[0] npm ERR! /Users/Sinan/.npm/_logs/2018-03-26T03_43_37_532Z-debug.log
[0] npm run server:dev exited with code 1
Package.json
{
"name": "Mean",
"version": "2.0.1",
"description": "A MEAN stack framework using Angular Webpack Starter kit - featuring Angular (Router, Http, Forms, Services, Tests, E2E, Coverage), Karma, Protractor, Jasmine, Istanbul, TypeScript, and Webpack",
"keywords": [
"angular",
"angular2",
"angular4",
"webpack",
"typescript"
],
"author": "Lior Kesos <lior#linnovate.net>",
"homepage": "http://mean.io",
"license": "MIT",
"scripts": {
"build:aot:prod": "npm run clean:dist && npm run clean:aot && cross-env BUILD_AOT=1 npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:aot": "npm run build:aot:prod",
"build:dev": "npm run clean:dist && npm run webpack -- --config config/webpack.dev.js --progress --profile",
"build:docker": "npm run build:prod && docker build -t angular2-webpack-start:latest .",
"build:prod": "npm run clean:dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build": "npm run build:dev",
"ci:aot": "npm run lint && npm run test && npm run build:aot && npm run e2e",
"ci:jit": "npm run lint && npm run test && npm run build:prod && npm run e2e",
"ci:nobuild": "npm run lint && npm test && npm run e2e",
"ci:testall": "npm run lint && npm run test && npm run build:prod && npm run e2e && npm run build:aot && npm run e2e",
"ci:travis": "npm run lint && npm run test && npm run build:aot && npm run e2e:travis",
"ci": "npm run ci:testall",
"clean:dll": "npm run rimraf -- dll",
"clean:aot": "npm run rimraf -- compiled",
"clean:dist": "npm run rimraf -- dist",
"clean:install": "npm set progress=false && npm install",
"clean": "npm cache clean && npm run rimraf -- node_modules doc coverage dist compiled dll",
"docker": "docker",
"docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
"e2e:live": "npm-run-all -p -r server:prod:ci protractor:live",
"e2e:travis": "npm-run-all -p -r server:prod:ci protractor:delay",
"e2e": "npm-run-all -p -r server:prod:ci protractor",
"github-deploy:dev": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubDev",
"github-deploy:prod": "npm run webpack -- --config config/webpack.github-deploy.js --progress --profile --env.githubProd",
"github-deploy": "npm run github-deploy:dev",
"lint": "npm run tslint \"src/**/*.ts\"",
"node": "node",
"postinstall": "npm run webdriver:update",
"postversion": "git push && git push --tags",
"preclean:install": "npm run clean",
"preversion": "npm test",
"protractor": "protractor",
"protractor:delay": "sleep 3 && npm run protractor",
"protractor:live": "protractor --elementExplorer",
"rimraf": "rimraf",
"server:dev:hmr": "npm run server:dev -- --inline --hot",
"server:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --open --progress --profile --watch --content-base src/",
"server:prod": "http-server dist -c-1 --cors",
"server:prod:ci": "http-server dist -p 3000 -c-1 --cors",
"server": "npm run server:dev",
"start:hmr": "npm run server:dev:hmr",
"start": "concurrently \"npm run server:dev\" \"nodemon --watch server server-start.js\" ",
"start:prod": "NODE_ENV=production node server-start.js",
"test": "npm run lint && karma start",
"tslint": "tslint",
"typedoc": "typedoc",
"version": "npm run build",
"watch:dev:hmr": "npm run watch:dev -- --hot",
"watch:dev": "npm run build:dev -- --watch",
"watch:prod": "npm run build:prod -- --watch",
"watch:test": "npm run test -- --auto-watch --no-single-run",
"watch": "npm run watch:dev",
"webdriver-manager": "webdriver-manager",
"webdriver:start": "npm run webdriver-manager start",
"webdriver:update": "webdriver-manager update",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
},
"dependencies": {
"#angular/animations": "~5.2.9",
"#angular/cdk": "~5.2.4",
"#angular/common": "^5.0.0",
"#angular/compiler": "~5.2.9",
"#angular/core": "^5.0.0",
"#angular/forms": "~5.2.9",
"#angular/http": "~5.2.9",
"#angular/material": "~5.2.4",
"#angular/platform-browser": "~5.2.9",
"#angular/platform-browser-dynamic": "~5.2.9",
"#angular/platform-server": "~5.2.9",
"#angular/router": "~5.2.9",
"#angularclass/hmr": "~2.1.3",
"#angularclass/hmr-loader": "~3.0.2",
"#ng-select/ng-select": "^0.30.1",
"#reactivex/rxjs": "^5.4.3",
"angular-in-memory-web-api": "~0.6.0",
"angular2-universal": "2.1.0-rc.1",
"apollo-angular": "^1.0.1",
"apollo-client": "^1.4.2",
"app-root-path": "^2.0.1",
"babel-cli": "^6.24.1",
"body-parser": "^1.17.2",
"casual": "^1.5.14",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"cors": "^2.8.3",
"dotenv": "^5.0.1",
"express": "^4.15.3",
"express-graphql": "^0.6.6",
"express-jwt": "^5.3.0",
"express-validation": "^1.0.2",
"express-winston": "^2.4.0",
"graphql": "^0.13.2",
"graphql-server-express": "latest",
"graphql-tag": "^2.2.2",
"graphql-tools": "^2.23.1",
"hammerjs": "^2.0.8",
"helmet": "^3.6.1",
"hll": "^1.1.0",
"http-server": "^0.11.1",
"http-status": "^1.0.1",
"ie-shim": "^0.1.0",
"innograph": "git://github.com/linnovate/innograph.git#devel",
"joi": "^13.1.2",
"jsonwebtoken": "^8.1.0",
"long": "^4.0.0",
"material": "^0.2.6",
"method-override": "^2.3.9",
"mongoose": "^5.0.11",
"mongoose-double": "0.0.1",
"morgan": "^1.8.2",
"ng2-go-top-button": "^4.1.0",
"ngx-carousel": "^1.3.5",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"preboot": "^5.0.0-rc.10",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"reflect-metadata": "^0.1.10",
"rxjs": "^5.4.3",
"sockjs-client": "^1.1.4",
"winston": "^2.3.1",
"zone.js": "latest"
},
"devDependencies": {
"#angular/compiler-cli": "~5.2.9",
"#ngtools/webpack": "^1.10.2",
"#types/hammerjs": "^2.0.34",
"#types/jasmine": "2.8.6",
"#types/node": "^9.6.0",
"#types/source-map": "^0.5.0",
"#types/uglify-js": "^3.0.0",
"#types/webpack": "^4.1.2",
"add-asset-html-webpack-plugin": "^2.1.3",
"angular2-template-loader": "^0.6.2",
"assets-webpack-plugin": "^3.5.1",
"awesome-typescript-loader": "~4.0.1",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-syntax-async-functions": "^6.13.0",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2017": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-register": "^6.24.1",
"codelyzer": "~4.2.1",
"concurrently": "^3.4.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.0",
"css-loader": "^0.28.0",
"exports-loader": "^0.7.0",
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "~3.0.2",
"file-loader": "^1.1.11",
"find-root": "^1.0.0",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "^3.1.0",
"imports-loader": "^0.8.0",
"inline-manifest-webpack-plugin": "^3.0.1",
"istanbul-instrumenter-loader": "3.0.0",
"jasmine-core": "^3.1.0",
"json-loader": "^0.5.4",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.3",
"karma-remap-coverage": "^0.1.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "~3.0.0",
"ng-router-loader": "^2.1.0",
"ngc-webpack": "~4.1.2",
"node-sass": "^4.5.2",
"nodemon": "^1.11.0",
"npm-run-all": "^4.0.2",
"optimize-js-plugin": "0.0.4",
"parse5": "^4.0.0",
"preload-webpack-plugin": "^2.3.0",
"protractor": "^5.1.1",
"raw-loader": "0.5.1",
"rimraf": "~2.6.1",
"sass-loader": "^6.0.3",
"script-ext-html-webpack-plugin": "^2.0.1",
"source-map-loader": "^0.2.1",
"string-replace-loader": "~2.1.1",
"style-loader": "~0.20.3",
"to-string-loader": "^1.1.5",
"ts-node": "~5.0.1",
"tslib": "^1.6.1",
"tslint": "~5.9.1",
"tslint-loader": "^3.5.2",
"typedoc": "^0.11.1",
"typescript": "~2.7.2",
"url-loader": "~1.0.1",
"webpack": "~4.2.0",
"webpack-cli": "^2.0.13",
"webpack-dev-middleware": "~3.0.1",
"webpack-dev-server": "^3.1.1",
"webpack-dll-bundles-plugin": "^1.0.0-beta.5",
"webpack-merge": "~4.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/AngularClass/angular-starter.git"
},
"bugs": {
"url": "https://github.com/AngularClass/angular-starter/issues"
},
"engines": {
"node": ">= 4.2.1",
"npm": ">= 3"
}
}
I just realized this was not a very well thought question however since other people might run into this I will keep the question up.
The problem is that config/webpack.common.js is out of date and tries to call on this deprecated class.
For a temporary work around is to comment out the following sections from config/webpack.common.js
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
AND
new CommonsChunkPlugin({
name: 'vendor',
chunks: ['main'],
minChunks: module => /node_modules/.test(module.resource)
}),
new ScriptExtHtmlWebpackPlugin({
sync: /polyfill|vendor/,
defaultAttribute: 'async',
preload: [/polyfill|vendor|main/],
prefetch: [/chunk/]
As of webpack4, tsConfigPath, is required to be specified.
You will also need to go under
ngcWebpack.NgcWebpackPlugin
and add
tsConfigPath: 'tsconfig.webpack.json',
ScriptExtHtmlWebpack seems to be an external library they use, which is also broken under webpack 4.
Note: Obviously commenting out all these things will have effects on your project. Just want to repeat once again that this is a temporary work around if you absolutely must use web pack 4.
I created a feature request that you can track here
Hopefully the config file will be updated as the transition to MEAN 2 takes place
Hope this helps

NPM requires a peer of but all peers are in package.json and node_modules

Im facing the problem that npm on install says
npm WARN eslint-config-react-app#2.0.1 requires a peer of babel-eslint#^7.2.3 but none was installed.
npm WARN eslint-config-react-app#2.0.1 requires a peer of eslint-plugin-jsx-a11y#^5.1.1 but none was installed.
npm WARN semantic-ui-react#0.74.2 requires a peer of react#>=0.14.0 <= 15 but none was installed.
npm WARN semantic-ui-react#0.74.2 requires a peer of react-dom#>=0.14.0 <= 15 but none was installed.
What I think is pretty weird is that I have in fact those dependencies in my package.json and also see them inside the node_modules folder.
My package.json:
{
"name": "react-box",
"version": "0.1.0",
"private": true,
"devDependencies": {
"autoprefixer": "7.1.4",
"babel-core": "6.26.0",
"babel-eslint": "^8.0.1",
"babel-jest": "21.2.0",
"babel-loader": "7.1.2",
"babel-preset-react-app": "^3.0.3",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "2.1.0",
"connect-history-api-fallback": "1.3.0",
"cross-spawn": "5.1.0",
"css-loader": "0.28.7",
"detect-port": "1.2.1",
"dotenv": "4.0.0",
"eslint": "4.8.0",
"eslint-config-react-app": "^2.0.1",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.38.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "7.4.0",
"extract-text-webpack-plugin": "3.0.1",
"file-loader": "1.1.5",
"filesize": "3.5.10",
"fs-extra": "4.0.2",
"gzip-size": "4.0.0",
"html-webpack-plugin": "2.30.1",
"http-proxy-middleware": "0.17.4",
"jest": "21.2.1",
"json-loader": "0.5.7",
"object-assign": "4.1.1",
"path-exists": "3.0.0",
"postcss-loader": "2.0.6",
"promise": "8.0.1",
"react-dev-utils": "^4.1.0",
"recursive-readdir": "2.2.1",
"strip-ansi": "4.0.0",
"style-loader": "0.19.0",
"truffle-contract": "^3.0.0",
"truffle-solidity-loader": "0.0.8",
"url-loader": "0.6.2",
"webpack": "3.6.0",
"webpack-dev-server": "2.9.1",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3"
},
"dependencies": {
"axios": "^0.16.2",
"babel-eslint": "^8.0.1",
"dotenv": "^2.0.0",
"react": "^16.0.0",
"react-countup": "^2.2.0",
"react-dom": "^16.0.0",
"semantic-ui-react": "^0.74.2"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.js?(x)",
"<rootDir>/src/**/?(*.)(spec|test).js?(x)"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"js",
"json",
"web.jsx",
"jsx"
]
},
"babel": {
"presets": [
"react-app"
]
},
"eslintConfig": {
"extends": "react-app"
}
}
When trying to install those peers manually like this:
npm install babel-eslint --save-dev
I still get the error:
├── UNMET PEER DEPENDENCY babel-eslint#8.0.1
├── UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y#6.0.2
├── UNMET PEER DEPENDENCY react#16.0.0
└── UNMET PEER DEPENDENCY react-dom#16.0.0
Maybe I dont understand how NPM works but to my understanding doing the installs manually at least should solve it, right?
If anyone needs more info just comment and I will provide the additional info. Thanks!
NPM warnings about peerDeps versions mismatch are correct here. These packages are installed, but installed versions is not supported by some other packages you have.
In your case - they're too new, meaning that maintainers of warning packages are not updated yet to these versions. And restricted required peerDeps version in API-compatible range (no breaking/major version leap).
eslint-config-react-app#2.0.1 requires a peer deps: babel-eslint#^7.2.3 (i.e. 7.x.x) and eslint-plugin-jsx-a11y#^5.1.1 (i.e. 5.x.x).
Your versions is "babel-eslint": "^8.0.1" and "eslint-plugin-jsx-a11y": "^6.0.2". The first digit - major - is not matched. This is what ^ (caret) mark is about.
Same with semantic-ui-react - they does not support react#16 yet (🤗 I can't wait too!).
Until then you can install packages with exact major version:
> npm view babel-eslint#7.* version // list released versions in required range 7.x.x
babel-eslint#7.0.0 '7.0.0'
babel-eslint#7.1.0 '7.1.0'
babel-eslint#7.1.1 '7.1.1'
babel-eslint#7.2.0 '7.2.0'
babel-eslint#7.2.1 '7.2.1'
babel-eslint#7.2.2 '7.2.2'
babel-eslint#7.2.3 '7.2.3'
> npm install --save-dev babel-eslint#7.2.3 // install latest version in required range
Same with other packages.
PS: also, in package.json you have to delete duplicated records: babel-eslint and dotenv in dependencies, since they are declared in devDependencies already.

Gulp failed after push

So I did this tutorial,(The basic Azure Cosmos DB (MongoDB) with Node.js)
https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-nodejs-mongodb-app
I didn't changed anything in the code just what tutorial says and after
git push azure master I get
gulp failed(link to image)
Does anyone have any clues from what comes this error?
Edit: deploy.sh Gulp part
if [ -e "$DEPLOYMENT_TARGET/gulpfile.js" ]; then
cd "$DEPLOYMENT_TARGET"
eval ./node_modules/.bin/gulp imagemin
eval ./node_modules/.bin/gulp prod <----I added this line and still fails
exitWithMessageOnError "gulp failed"
cd - > /dev/null
fi
package.json only Gulp part
{
"name": "meanjs",
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
"version": "0.5.0",
"meanjs-version": "0.5.0",
"private": false,
"author": "https://github.com/meanjs/mean/graphs/contributors",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/meanjs/mean.git"
},
"engines": {
"node": "6.9.1",
"npm": "3.10.8"
},
"scripts": {
"update": "npm update && npm prune && npm run bower",
"clean": "rm -rf node_modules/ public/lib/",
"reinstall": "npm cache clean && npm run clean && npm install",
"start": "gulp",
"start:prod": "gulp prod",
"start:debug": "node-debug --web-host 0.0.0.0 server.js & gulp debug",
"gulp": "gulp",
"bower": "bower install --allow-root && bower prune --allow-root",
"lint": "gulp lint",
"test": "gulp test",
"test:server": "gulp test:server",
"test:server:watch": "gulp test:server:watch",
"test:client": "gulp test:client",
"test:e2e": "gulp test:e2e",
"test:coverage": "gulp test:coverage",
"postinstall": "npm run bower",
"generate-ssl-certs": "scripts/generate-ssl-certs.sh"
},
"dependencies": {
"passport-google-oauth": "~1.0.0",
"passport-linkedin": "~1.0.0",
"passport-local": "~1.0.0",
"passport-paypal-openidconnect": "~0.1.1",
"passport-twitter": "~1.0.4",
"serve-favicon": "~2.4.2",
"socket.io": "^2.0.2",
"validator": "~7.0.0",
"winston": "^2.3.1",
"wiredep": "~4.0.0"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-angular-templatecache": "~2.0.0",
"gulp-autoprefixer": "~3.1.0",
"gulp-concat": "~2.6.0",
"gulp-csslint": "~1.0.0",
"gulp-csso": "~3.0.0",
"gulp-eslint": "~3.0.1",
"gulp-imagemin": "~3.2.0",
"gulp-istanbul": "~1.1.1",
"gulp-less": "~3.3.0",
"gulp-load-plugins": "~1.5.0",
"gulp-mocha": "~3.0.1",
"gulp-ng-annotate": "~2.0.0",
"gulp-nodemon": "~2.2.1",
"gulp-protractor": "^4.0.0",
"gulp-refresh": "~1.1.0",
"gulp-rename": "~1.2.2",
"gulp-rev": "^7.1.2",
"gulp-sass": "~3.1.0",
"gulp-uglify": "~2.1.2",
"gulp-util": "~3.0.7",
}
}
I also get this error on the begin of the push logs
remote: glob error { Error: ENOTSUP: operation not supported on socket, scandir 'D:\home\site\wwwroot\node_modules\phant
omjs-prebuilt\node_modules\request\node_modules\http-signature\node_modules\sshpk\bin\sshpk-conv'
remote: at Error (native)
Edit2: The error changed a bit
remote: An error has occurred during web site deployment.
remote: throw err;
remote: gulp failed
remote: ^
remote: Error: Cannot find module 'readable-stream/transform'
You did install gulp. Make sure you have installed gulp-cli.
And, as mentioned in "no command 'gulp' found - after installation"
Also, node_modules/.bin/ isn't in your %PATH%.
But it is automatically added by npm when running npm scripts (see this blog post for reference).

How to resolve gulp dependencies while creating a NPM package

I have a nodeJs application(demo) which using commander package to take command line argument and using gulp for
build
docs
test
coverage
This functionality is working fine but Now I need to move this application as a NPM Package.
Changes are done according to according NPM Package but when I install this as NPM package npm install ../demo/ from local location.
It asks for following gulp dependencies: -
Cannot find module gulp
Cannot find module gulp-load-plugins
Cannot find module del
Cannot find module gulp-plumber
Cannot find module gulp-eslint
Cannot find module babel-eslint
Cannot find module gulp-debug
Cannot find module gulp-sourcemaps
Cannot find module gulp-babel
Every time I go back to the npm package(which i created) directory and run the command which occurs as an error like npm install gulp --save-dev and npm install del --save-dev and so on.
I also defined these dependencies in package.json but it is still throwing errors.
Is there any way to resolve this issue.
package.json
{
"name": "demo",
"version": "0.0.1",
"description": "",
"main": "./dist/index.js",
"license": "SEE LICENSE IN LICENSE.md",
"keywords": [],
"scripts": {
"build": "gulp build",
"coverage": "gulp coverage",
"docs": "gulp docs",
"prepublish": "gulp build",
"test": "gulp test"
},
"dependencies": {
"autobind-decorator": "^1.3.3",
"babel-polyfill": "^6.6.1",
"commander": "^2.9.0",
"lodash": "^4.0.0",
"mustache": "^2.2.1",
"source-map-support": "^0.4.0",
"wrench": "^1.5.8",
"ms": "^0.7.1"
"babel-eslint": "^6.0.4",
"babel-plugin-lodash": "^2.2.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-nodejs-lts": "^1.2.2",
"chai": "^3.5.0",
"del": "^2.2.0",
"esdoc-es7-plugin": "^0.0.3",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-babel-istanbul": "^1.1.0",
"gulp-debug": "^2.1.2",
"gulp-esdoc": "^0.2.0",
"gulp-eslint": "^2.0.0",
"gulp-filter": "^4.0.0",
"gulp-inject-modules": "^0.1.1",
"gulp-load-plugins": "^1.2.2",
"gulp-mocha": "^2.2.0",
"gulp-plumber": "^1.1.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"btoa": "^1.1.2",
"superagent": "^2.1.0"
},
"engines": {
"node": ">=4.0.0"
}
}
I put all the things in dependencies. I tried that way but having same problem.
npm install ../demo/
npm WARN package.json demo_project#1.0.0 No description
npm WARN package.json demo_project#1.0.0 No repository field.
npm WARN package.json demo_project#1.0.0 No README data
> demo#0.0.1 prepublish /work/demo
> gulp build
[16:53:33] Local gulp not found in ~/work/demo
[16:53:33] Try running: npm install gulp
Although the documentation doesn't mention it, npm install folder only installs dependencies and not devDependencies. This may be a little bit confusing as running npm install inside the package folder installs both dependenciesand devDependencies.
So try to install gulpand all the rest as npm install --save gulp (not
--save-dev)
UPDATE: after adding package.json:
everything under devDependencies in your package.json should be under dependencies:
{
"name": "demo",
"version": "0.0.1",
"description": "",
"main": "./dist/index.js",
"license": "SEE LICENSE IN LICENSE.md",
"keywords": [],
"scripts": {
"build": "gulp build",
"coverage": "gulp coverage",
"docs": "gulp docs",
"prepublish": "gulp build",
"test": "gulp test"
},
"dependencies": {
"autobind-decorator": "^1.3.3",
"babel-polyfill": "^6.6.1",
"commander": "^2.9.0",
"lodash": "^4.0.0",
"mustache": "^2.2.1",
"source-map-support": "^0.4.0",
"wrench": "^1.5.8",
"ms": "^0.7.1",
"babel-eslint": "^6.0.4",
"babel-plugin-lodash": "^2.2.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-nodejs-lts": "^1.2.2",
"chai": "^3.5.0",
"del": "^2.2.0",
"esdoc-es7-plugin": "^0.0.3",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-babel-istanbul": "^1.1.0",
"gulp-debug": "^2.1.2",
"gulp-esdoc": "^0.2.0",
"gulp-eslint": "^2.0.0",
"gulp-filter": "^4.0.0",
"gulp-inject-modules": "^0.1.1",
"gulp-load-plugins": "^1.2.2",
"gulp-mocha": "^2.2.0",
"gulp-plumber": "^1.1.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"btoa": "^1.1.2",
"superagent": "^2.1.0"
},
"engines": {
"node": ">=4.0.0"
}
}

Resources