So I tried to deploy my app to Heroku and find this error Module not found: Error: Can't resolve './components/add-credentials/AddEducation' in '/tmp/build_6b46c3e828c5afc20e70a4b1b2232f69/client/src'
Everything works fine including that module in localhost. What should I change for this to work?
Complete Build Log
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 8.11.x
engines.npm (package.json): 5.6.x
engines.yarn (package.json): 1.9.x
Resolving node version 8.11.x...
Downloading and installing node 8.11.4...
Bootstrapping npm 5.6.x (replacing 5.6.0)...
npm 5.6.x installed
Resolving yarn version 1.9.x...
Downloading and installing yarn (1.9.4)...
Installed yarn 1.9.4
-----> Building dependencies
Installing node modules (yarn.lock)
yarn install v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.4: The platform "linux" is incompatible with this module.
info "fsevents#1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 13.99s.
Running heroku-postbuild (yarn)
yarn run v1.9.4
$ NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
> uglifyjs-webpack-plugin#0.4.6 postinstall /tmp/build_6b46c3e828c5afc20e70a4b1b2232f69/client/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
added 1546 packages in 41.748s
> client#0.1.0 build /tmp/build_6b46c3e828c5afc20e70a4b1b2232f69/client
> react-scripts build
Creating an optimized production build...
Failed to compile.
Module not found: Error: Can't resolve './components/add-credentials/AddEducation' in '/tmp/build_6b46c3e828c5afc20e70a4b1b2232f69/client/src'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.1.0 build 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! /tmp/npmcache.te6Qt/_logs/2018-09-14T23_46_37_674Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
Package.json
{
"name": "devconnector",
"version": "1.0.0",
"description": "Social network for developers",
"engines": {
"node": "8.11.x",
"npm": "5.6.x",
"yarn": "1.9.x"
},
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "Dian Yuanda",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"concurrently": "^4.0.1",
"create-react-app": "^1.5.2",
"express": "^4.16.3",
"global": "^4.3.2",
"gravatar": "^1.6.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"devDependencies": {
"nodemon": "^1.17.5"
}
}
Related
Im trying to deploy a Next app using vercel cli. I have run vercel build and that was completed successfully with no errors - context provided below. I have run the vercel deploy --prebuilt command and it was deployed with no errors. When I try to move the project from the preview enviroment to the production environment I error
Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
this is my package.json
{
"name": "portfolio-website",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#heroicons/react": "^2.0.12",
"#next/swc-darwin-x64": "^12.3.2",
"framer-motion": "^7.6.2",
"next": "^12.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.38.0",
"react-simple-typewriter": "^4.0.5",
"react-social-icons": "^5.15.0"
},
"devDependencies": {
"#types/node": "18.11.7",
"#types/react": "18.0.24",
"#types/react-dom": "18.0.8",
"autoprefixer": "^10.4.12",
"eslint": "8.26.0",
"eslint-config-next": "13.0.0",
"postcss": "^8.4.18",
"tailwind-scrollbar": "^2.0.1",
"tailwindcss": "^3.2.1",
"typescript": "4.8.4"
},
"optionalDependencies": {
"#next/swc-linux-x64-gnu": "12.3.2"
}
}
I also had the error - for the context
warn - Attempted to load #next/swc-darwin-x64, but it was not installed
error - Failed to load SWC binary for darwin/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
info - Creating an optimized production build .Error: Command "npm run build" exited with
I had to delete my package.lock.json fill and node_modules and run npm i #next/swc-darwin-x64 and npm i even tho the dependency at the time was already in my lock file.
I have also tried downgrading my next version but to no avail.
Have tried deploying directly from my git repository but i aslo get the same error
[22:29:17.748] Cloning github.com/xxxxx/xxxxxx (Branch: main, Commit: 0fb5a5a)
[22:29:18.540] Cloning completed: 791.508ms
[22:29:19.131] Looking up build cache...
[22:29:19.371] Build Cache not found
[22:29:19.420] Running "vercel build"
[22:29:20.057] Vercel CLI 28.4.12-05a80a4
[22:29:20.485] Installing dependencies...
[22:29:21.273] npm ERR! code EBADPLATFORM
[22:29:21.275] npm ERR! notsup Unsupported platform for #next/swc-darwin-x64#12.3.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
[22:29:21.276] npm ERR! notsup Valid OS: darwin
[22:29:21.276] npm ERR! notsup Valid Arch: x64
[22:29:21.276] npm ERR! notsup Actual OS: linux
[22:29:21.276] npm ERR! notsup Actual Arch: x64
[22:29:21.279]
[22:29:21.279] npm ERR! A complete log of this run can be found in:
[22:29:21.279] npm ERR! /vercel/.npm/_logs/2022-11-02T21_29_20_898Z-debug-0.log
[22:29:21.290] Warning: Could not identify Next.js version, ensure it is defined as a project dependency.
[22:29:21.364] Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
I have been getting this error on vercel deployments although I have a next in the dependencies. What I find has been letting me get a good deployment is clearing the cache via
git rm -r --cached .
git add --all .
git commit -a -m "Versioning untracked files"
git push origin master
When this does not work for me I delete the yarn.lock file and get a good build, maybe a conflict between npm and yarn
I'm trying to deploy my create-react-app using Heroku. When I do git push heroku master, the build fails.
This is the error log:
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.16.3...
Using default npm version: 6.14.4
-----> Installing dependencies
Installing node modules (package.json + package-lock)
> nodemailer#6.4.6 postinstall /tmp/build_258ba2b79ac9e7091bc7dd79a031dd4f/node_modules/nodemailer
> node -e "try{require('./postinstall')}catch(e){}"
=== Nodemailer 6.4.6 ===
Thank you for using Nodemailer for your email sending needs! While Nodemailer
itself is mostly meant to be a SMTP client there are other related projects in
the Nodemailer project as well.
For example:
> IMAP API ( https://imapapi.com ) is a server application to easily access
IMAP accounts via REST API
> NodemailerApp ( https://nodemailer.com/app/ ) is a cross platform GUI app to
debug emails
> styled-components#4.2.0 postinstall /tmp/build_258ba2b79ac9e7091bc7dd79a031dd4f/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0
Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
added 1914 packages from 1179 contributors and audited 2053 packages in 49.627s
1 package is looking for funding
run `npm fund` for details
found 56466 vulnerabilities (39341 low, 26 moderate, 17098 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
-----> Build
Running build
> juliesong#0.1.0 build /tmp/build_258ba2b79ac9e7091bc7dd79a031dd4f
> react-scripts build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
Failed to compile.
./src/components/PageIntro.js
Cannot find module: 'axios'. Make sure this package is installed.
You can install this package by running: npm install axios.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! juliesong#0.1.0 build: `react-scripts build `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the juliesong#0.1.0 build 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! /tmp/npmcache.6BFeR/_logs/2020-05-17T06_58_22_399Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
- A module may be missing from 'dependencies' in package.json
https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies
Love,
Heroku
! Push rejected, failed to compile React.js (create-react-app) multi app.
! Push failed
Here's my package.json file, in case it helps:
{
"name": "juliesong",
"version": "0.1.0",
"private": true,
"homepage": "https://www.juliesong.me",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.17.1",
"nodemailer": "^6.4.6",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-preloaders": "^3.0.3",
"react-responsive": "^6.1.2",
"react-responsive-carousel": "^3.1.49",
"react-responsive-simple": "^0.1.2",
"react-router-dom": "^4.1.1",
"react-router-hash-link": "^1.2.1",
"react-scripts": "^3.0.0",
"styled-components": "^4.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build ",
"test": "react-scripts test",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 9009 -s public",
"build-storybook": "build-storybook -s public",
"predeploy": "npm run build && cp build/index.html build/404.html",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"#babel/core": "^7.4.3",
"#storybook/addon-actions": "^5.0.6",
"#storybook/addon-links": "^5.0.6",
"#storybook/addons": "^5.0.6",
"#storybook/react": "^5.0.6",
"babel-loader": "^8.0.5",
"gh-pages": "^2.2.0"
},
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/jiyoonee/Website-Portfolio.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/jiyoonee/Website-Portfolio/issues"
}
}
I did try to work around with gh-pages but it didn't seem to work so I tried switching to Heroku. It's my first time using it so any help on this issue would be appreciated. Thanks!
I'm stuck at deploying my reactJS web application to Heroku.
It worked fine on the local machine. I got problems with permission when Build section runs.
I don't know what did I wrong, everything else in this course works fine.
I tried to deploy the app with GitHub connection, but I got the same error.
I tried to run this code in terminal NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client, but I got another error (NPM... is not a command).
my package.json file :
{
"name": "contactkeeper",
"version": "1.0.0",
"description": "Contact manager app",
"main": "server.js",
"engines": {
"node": "^12.4.0"
},
"scripts": {
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"clientinstall": "npm install --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"keywords": [],
"author": "vinogitz",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"config": "^3.1.0",
"express": "^4.17.1",
"express-validator": "^6.1.1",
"jsonwebtoken": "^8.5.1",
"lodash.template": "^4.5.0",
"mongoose": "^5.6.3"
},
"devDependencies": {
"concurrently": "^4.1.1",
"nodemon": "^1.19.1"
}
}
my gitignore like this:
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
#client/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-----> Build
Running heroku-postbuild
> contactkeeper#1.0.0 heroku-postbuild /tmp/build_5e4bd7bd79fb3c0f84bb21cb820d7594
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
audited 902208 packages in 13.316s
found 0 vulnerabilities
> client#0.1.0 build /tmp/build_5e4bd7bd79fb3c0f84bb21cb820d7594/client
> react-scripts build
sh: 1: react-scripts: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! client#0.1.0 build: `react-scripts build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the client#0.1.0 build 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! /tmp/npmcache.BWDxV/_logs/2019-07-22T11_55_03_878Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! contactkeeper#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the contactkeeper#1.0.0 heroku-postbuild 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! /tmp/npmcache.BWDxV/_logs/2019-07-22T11_55_03_893Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I found the problem. the permission denied is not the perfect error message, but i found the solution.
I tried to ignore the node_modules folder in my client folder with .gitignore, but I didn't find the solution first time, so I just delete the sub folder node_modules from project. After that, I tried to deploy it again, and it's worked. So the real problem was that, the git add, git commit, git push commands pushed the node_modules sub folder to the repository.
PS.: The solution is: write node_modules/ instead of /node_modules in gitignore. With this the node_modules folders in a project (root folder or in a sub folder get untracked.)
Thanks!
I'm trying to run tutorials from angular.io. I'm getting an error on npm start.
Here is the error. I tried to uninstal all npm, typescript, node, angular.
First part of the error:
npm WARN invalid config loglevel="notice"
> angular-quickstart#1.0.0 build C:\Users\Gia\quickstart
> tsc -p src/
src/app/app.component.spec.ts(3,50): error TS2307: Cannot find module '#angular/core/testing'.
src/app/app.component.spec.ts(4,30): error TS2307: Cannot find module '#angular/platform-browser'.
src/app/app.component.spec.ts(5,30): error TS2307: Cannot find module '#angular/core'.
src/app/app.component.spec.ts(7,1): error TS2304: Cannot find name 'describe'.
src/app/app.component.spec.ts(12,3): error TS2304: Cannot find name 'beforeEach'.
src/app/app.component.spec.ts(19,3): error TS2304: Cannot find name 'beforeEach'.
src/app/app.component.spec.ts(25,3): error TS2304: Cannot find name 'it'.
src/app/app.component.spec.ts(25,39): error TS2304: Cannot find name 'expect'.
src/app/app.component.spec.ts(27,3): error TS2304: Cannot find name 'it'.
src/app/app.component.spec.ts(30,5): error TS2304: Cannot find name 'expect'.
src/app/app.component.ts(1,27): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(1,31): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(2,31): error TS2307: Cannot find module '#angular/platform-browser'.
src/main.ts(1,40): error TS2307: Cannot find module '#angular/platform-browser-dynamic'.
The second part of the error:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 build 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! C:\Users\Gia\AppData\Roaming\npm-cache\_logs\2017-06-12T15_05_48_144Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is the package.json file:
{
"name": "angular-quickstart",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run tsc:w\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"#angular/common": "~4.0.0",
"#angular/compiler": "~4.0.0",
"#angular/core": "~4.0.0",
"#angular/forms": "~4.0.0",
"#angular/http": "~4.0.0",
"#angular/platform-browser": "~4.0.0",
"#angular/platform-browser-dynamic": "~4.0.0",
"#angular/router": "~4.0.0",
"angular": "^1.6.4",
"angular-in-memory-web-api": "~0.3.0",
"core-js": "^2.4.1",
"node": "0.0.0",
"rxjs": "5.0.1",
"systemjs": "0.19.40",
"zone.js": "^0.8.4"
},
"devDependencies": {
"concurrently": "^3.2.0",
"lite-server": "^2.2.2",
"typescript": "~2.1.0",
"canonical-path": "0.0.2",
"tslint": "^3.15.1",
"lodash": "^4.16.4",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~4.0.14",
"rimraf": "^2.5.4",
"#types/node": "^6.0.46",
"#types/jasmine": "2.5.36"
},
"repository": {}
}
Here is an error after installing npm in the folder of application:
src/app/app.component.spec.ts(3,50): error TS2307: Cannot find module '#angular/core/testing'.
src/app/app.component.spec.ts(4,30): error TS2307: Cannot find module '#angular/platform-browser'.
src/app/app.component.spec.ts(5,30): error TS2307: Cannot find module '#angular/core'.
src/app/app.component.ts(1,27): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(1,31): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(2,31): error TS2307: Cannot find module '#angular/platform-browser'.
src/main.ts(1,40): error TS2307: Cannot find module '#angular/platform-browser-dynamic'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 build 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! C:\Users\Gia\AppData\Roaming\npm-cache\_logs\2017-06-12T15_26_01_665Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Those are mostly errors within the test files or missing imports within each component. You need to fix all of them before you can compile your app successfully. It doesn't seem to be a bug.
I suggest using angular-cli to create a new angular app and keep on building the tutorial components from there. Angular-cli is the official tool for creating and scaffolding angular apps.
I've looked through similar stackoverflow questions and none of them seem to work for me. I've been trying to deploy my NodeJS app to Heroku but keep bumping into this message from heroku regarding bower. I have tried manually writing bower in my dependencies but that has not worked, I also tried moving my dependencies from bower.json to package.json but that also didn't work. Thank you guy so much, I have put my heroku logs, package.json, and bower.json files below.
angular-seed#0.0.0 postinstall /tmp/build_370f51a52877a36d300c739f31855511
remote: > bower install
remote:
remote: sh: 1: bower: not found
I have listed below my package.json and my bower.json files.
Package.json
"name": "angular-seed",
"private": true,
"version": "0.0.0",
"description": "A starter project for AngularJS",
"repository": "https://github.com/angular/angular-seed",
"license": "MIT",
"devDependencies": {
"bower": "^1.7.7",
"http-server": "^0.9.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"karma-junit-reporter": "^0.4.1",
"protractor": "^3.2.2"
},
"scripts": {
"postinstall": "bower install",
"prestart": "npm install",
"start": "http-server -a localhost -p 8000 -c-1 ./app",
"pretest": "npm install",
"test": "karma start karma.conf.js",
"test-single-run": "karma start karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor e2e-tests/protractor.conf.js",
},
"dependencies":{
"bower": "^1.7.9"
}
}
Bower.json
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.5.0",
"angular-route": "~1.5.0",
"angular-loader": "~1.5.0",
"angular-mocks": "~1.5.0",
"html5-boilerplate": "^5.3.0"
}
}
Heroku
remote: -----> Creating runtime environment
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: Resolving node version (latest stable) via semver.io...
remote: Downloading and installing node 5.11.1...
remote: Using default npm version: 3.8.6
remote: -----> Restoring cache
remote: Skipping cache restore (new runtime signature)
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote: > angular-seed#0.0.0 postinstall /tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca
remote: > bower install
remote: sh: 1: bower: not found
remote: npm ERR! Linux 3.13.0-95-generic
remote: npm ERR! argv
/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.heroku/node/bin/node" "/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.npmrc"
remote: npm ERR! node v5.11.1
remote: npm ERR! npm v3.8.6
remote: npm ERR! file sh
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno ENOENT
remote: npm ERR! syscall spawn
remote: npm ERR! angular-seed#0.0.0 postinstall: `bower install`
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the angular-seed#0.0.0 postinstall script
bower install'.
remote: npm ERR! Make sure you have the latest version of node.js and npm installed.
remote: npm ERR! If you do, this is most likely a problem with the angular-seed package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! bower install
remote: npm ERR! You can get information on how to open an issue for this project with
remote: npm ERR! npm bugs angular-seed
remote: npm ERR! Or if that isn't available, you can get their info via:
remote: npm ERR! npm owner ls angular-seed
remote: npm ERR! There is likely additional logging output above.
remote: npm ERR! Please include the following file with any support
remote: npm ERR! /tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/npm-debug.log
remote: -----> Build failed
Try this instead for the postinstall:
"postinstall": "./node_modules/bower/bin/bower install"
This is because bower is installed locally in the specified path, not globally.