How do I debug a create-react-app on AWS Amplify - javascript

I'm following the tutorial on AWS Amplify to deploy a simple create-react-app. No code added to the initial boiler plate. However when I deploy the app and check the Url i see a:
This main.d1m8xst4r8xkbi.amplifyapp.com page can’t be found
Any clues on how i can proceed?
edit this was the build file:
version: 1
frontend:
phases:
# IMPORTANT - Please verify your build commands
build:
commands: []
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: /
files:
- '**/*'
cache:
paths: []
edit2 The command is "react-scripts build" and the build folder should share a directory with the package.json so I tried modifying the commands and files as follows:
build:
commands:
- "react-scripts build"
....
files:
- "build"
and it now throws a build error. I think I'm missing something and my syntax is off (sorry first time doing this!)
If I look at the build log for this error it shows:
2021-03-28T17:22:49.752Z [INFO]: ## Starting Frontend Build
# Starting phase: build
# Executing command: react-scripts build
edit3, i tried this:
version: 1
frontend:
phases:
# IMPORTANT - Please verify your build commands
build:
commands: "react-scripts build"
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: "/build"
files:
cache:
paths: []
and got this in the logs:
version: 1
frontend:
phases:
# IMPORTANT - Please verify your build commands
build:
commands: "react-scripts build"
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: "/build"
files:
cache:
paths: []
edit:
I've tried different things, including copying verbatim screenshots from the AWS amplify "hello world" tutorial. It's not working. I'm very confused as this is my first time deploying. Help is appreciated and encouraging!
edit, here is the build log from your suggestion:
# Starting phase: preBuild
# Executing command: npm install
2021-04-03T10:30:06.970Z [WARNING]: npm
2021-04-03T10:30:06.970Z [WARNING]: WARN saveError ENOENT: no such file or directory, open '/codebuild/output/src437022859/src/L34-1/package.json'
2021-04-03T10:30:06.974Z [WARNING]: npm
2021-04-03T10:30:06.974Z [WARNING]: notice created a lockfile as package-lock.json. You should commit this file.
2021-04-03T10:30:06.976Z [WARNING]: npm
2021-04-03T10:30:06.976Z [WARNING]: WARN enoent ENOENT: no such file or directory, open '/codebuild/output/src437022859/src/L34-1/package.json'
2021-04-03T10:30:06.980Z [WARNING]: npm
2021-04-03T10:30:06.980Z [WARNING]: WARN L34-1 No description
2021-04-03T10:30:06.984Z [WARNING]: npm
2021-04-03T10:30:06.984Z [WARNING]: WARN L34-1 No repository field.
2021-04-03T10:30:06.988Z [WARNING]: npm
2021-04-03T10:30:06.988Z [WARNING]: WARN L34-1 No README data
2021-04-03T10:30:06.992Z [WARNING]: npm
2021-04-03T10:30:06.992Z [WARNING]: WARN L34-1 No license field.
2021-04-03T10:30:06.992Z [WARNING]:
2021-04-03T10:30:07.239Z [INFO]: up to date in 0.365s
2021-04-03T10:30:07.239Z [INFO]: found 0 vulnerabilities
2021-04-03T10:30:07.323Z [INFO]: # Completed phase: preBuild
# Starting phase: build
2021-04-03T10:30:07.324Z [INFO]: # Executing command: npm run build
2021-04-03T10:30:07.471Z [WARNING]: npm
2021-04-03T10:30:07.471Z [WARNING]: ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /codebuild/output/src437022859/src/L34-1/package.json
npm ERR! errno -2
2021-04-03T10:30:07.472Z [WARNING]: npm
2021-04-03T10:30:07.473Z [WARNING]: ERR! enoent ENOENT: no such file or directory, open '/codebuild/output/src437022859/src/L34-1/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
2021-04-03T10:30:07.479Z [WARNING]:
2021-04-03T10:30:07.479Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-04-03T10_30_07_473Z-debug.log
2021-04-03T10:30:07.479Z [HELP]: Outputting the npm debug log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/root/.nvm/versions/node/v12.21.0/bin/node',
1 verbose cli '/root/.nvm/versions/node/v12.21.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.11
3 info using node#v12.21.0
4 verbose stack Error: ENOENT: no such file or directory, open '/codebuild/output/src437022859/src/L34-1/package.json'
5 verbose cwd /codebuild/output/src437022859/src/L34-1
6 verbose Linux 4.14.219-119.340.amzn1.x86_64
7 verbose argv "/root/.nvm/versions/node/v12.21.0/bin/node" "/root/.nvm/versions/node/v12.21.0/bin/npm" "run" "build"
8 verbose node v12.21.0
9 verbose npm v6.14.11
10 error code ENOENT
11 error syscall open
12 error path /codebuild/output/src437022859/src/L34-1/package.json
13 error errno -2
14 error enoent ENOENT: no such file or directory, open '/codebuild/output/src437022859/src/L34-1/package.json'
15 error enoent This is related to npm not being able to find a file.
16 verbose exit [ -2, true ]
2021-04-03T10:30:07.482Z [ERROR]: !!! Build failed
2021-04-03T10:30:07.482Z [ERROR]: !!! Non-Zero Exit Code detected
2021-04-03T10:30:07.482Z [INFO]: # Starting environment caching...
2021-04-03T10:30:07.482Z [INFO]: # Environment caching completed
Terminating logging...

I know maybe is obvious, but before deploy do you generated the build files? If not, you need to use this command below:
npm run build

Update your build setting as below in the Apps build settings in the AWS console.
version: 1
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- npm run build
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Once the build settings are updated, we need to add URL redirect's for React SPA under "Redirects and rewrites" in app settings.
Source Address:
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
Target Address:
/index.html
Read more here - https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa

Related

Errors when installing WebdriverIo

Installing wdio packages:
- #wdio/local-runner
- #wdio/mocha-framework
- #wdio/spec-reporter
- wdio-chromedriver-service
- chromedriver
npm WARN deprecated #types/easy-table#1.2.0: This is a stub types definition. easy-table provides its own type definitions, so you do not need this installed.
added 115 packages, and audited 459 packages in 13s
92 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Packages installed successfully, creating configuration file...
Config file installed successfully, creating test files...
Configuration file was created successfully!
To run your tests, execute:
$ npx wdio run wdio.conf.js
Adding "wdio" script to package.json.
Unknown command: "set-script"
Did you mean this?
npm run-script # Run arbitrary package scripts
To see a list of supported npm commands, run:
npm help
file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19
return reject(new Error((error && error.message) ||
^
Error: Error calling: npm set-script wdio wdio run wdio.conf.js
at ChildProcess.<anonymous> (file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19:31)
at ChildProcess.emit (node:events:513:28)
at cp.emit (C:\Users\User\AppData\Local\npm-cache\_npx\46b5fbaa5aefb2df\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
Node.js v18.12.1
npm ERR! code 1
npm ERR! path C:\Users\User\Downloads\webdriverio
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-wdio .
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-11-26T14_16_31_932Z-debug-0.log
I don't understand why did I get such errors? Now I'll try to describe you detailed what I did I made several steps:
Download the latest node.js version via https://nodejs.org/en/download/
I set NODE_HOME in system variables
Created empty folder
Opened empty folder in command prompt, (cd 'path to this empty folder')
Wrote 'npm init wdio .' into the command prompt
Then I just chose the default options
I was waiting and such errors appeared
I tried to update npm to the latest version. It doesn't help.

Cant build React app - pipeline fails miserably

---> Running in 0e34d471598d
> myproject#1.0.0 build /app
> node scripts/build.js
Could not find a required file.
Name: index.html
Searched in: /app/public
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproject#1.0.0 build: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproject#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! /root/.npm/_logs/2021-08-05T14_49_57_665Z-debug.log
The command '/bin/sh -c npm run build ;' returned a non-zero code: 1
##[error]The command '/bin/sh -c npm run build ;' returned a non-zero code: 1
##[error]The process '/usr/bin/docker' failed with exit code 1
So there is the error "can't find file" but actually THERE IS a public directory with the index.html file inside. I don't know why this is happening...
Edit: Im adding the docker file used in config pipe
# -- Base node --
FROM node:13.7-alpine AS build
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
ARG BUILD_ENV
RUN npm run build ;
# -- final build --
FROM nginx:1.17.8-alpine
COPY --from=build /app/build /var/www
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
I notice you are running this on docker, so you did wrong on docker during copy your react app directory to docker container.
You have not added your Dockerfile code here
So we suggest you to fix your dockerfile first. Also check your .dockerignore file and debug getting into docker container, if the directory exist there or not
So your docker file should be similar to this
COPY . ./
RUN npm run build
It should be like this (Not . /app):
# Copy other project files and build
COPY . ./
RUN npm run build

How do I install dependencies that NPM refuses to install?

On running a docker build, I get an error with core-js dependencies missing. On running npm's suggested install command, I get another error. I tried to revert to a couple of earlier branches, but no cigar.
The error on docker build . is:
ERROR Failed to compile with 122 errors5:31:56 AM
These dependencies were not found:
* core-js/modules/es6.array.copy-within in ./src/main.js
* core-js/modules/es6.array.fill in ./src/main.js
* core-js/modules/es6.array.find in ./src/main.js
* core-js/modules/es6.array.find-index in ./src/main.js
* core-js/modules/es6.array.from in ./src/main.js
* core-js/modules/es6.array.iterator in ./src/main.js
* core-js/modules/es6.array.of in ./src/main.js
* core-js/modules/es6.array.sort in ./src/main.js
* core-js/modules/es6.array.species in ./src/main.js
* core-js/modules/es6.date.to-primitive in ./src/main.js
...
Along with another hundred similar lines, followed by this suggestion:
To install them, you can run: npm install --save core-js/modules/es6.array.copy-within core-js/modules/es6.array.fill core-js/modules/es6.array.find core-js/modules/es6.array.find-index core-js/modules/es6.array.from core-js/modules/es6.array.iterator core-js/modules/es6.array.of core-js/modules/es6.array.sort core-js/modules/es6.array.species core-js/modules/es6.date.to-primitive core-js/modules/es6.function.has-instance core-js/modules/es6.function.name core-js/modules/es6.map core-js/modules/es6.math.acosh core-js/modules/es6.math.asinh core-js/modules/es6.math.atanh core-js/modules/es6.math.cbrt core-js/modules/es6.math.clz32 core-js/modules/es6.math.cosh core-js/modules/es6.math.expm1 core-js/modules/es6.math.fround core-js/modules/es6.math.hypot core-js/modules/es6.math.imul core-js/modules/es6.math.log10 core-js/modules/es6.math.log1p core-js/modules/es6.math.log2 core-js/modules/es6.math.sign core-js/modules/es6.math.sinh core-js/modules/es6.math.tanh core-js/modules/es6.math.trunc core-js/modules/es6.number.constructor core-js/modules/es6.number.epsilon core-js/modules/es6.number.is-finite core-js/modules/es6.number.is-integer core-js/modules/es6.number.is-nan core-js/modules/es6.number.is-safe-integer core-js/modules/es6.number.max-safe-integer core-js/modules/es6.number.min-safe-integer core-js/modules/es6.number.parse-float core-js/modules/es6.number.parse-int core-js/modules/es6.object.assign core-js/modules/es6.object.freeze core-js/modules/es6.object.get-own-property-descriptor core-js/modules/es6.object.get-own-property-names core-js/modules/es6.object.get-prototype-of core-js/modules/es6.object.is core-js/modules/es6.object.is-extensible core-js/modules/es6.object.is-frozen core-js/modules/es6.object.is-sealed core-js/modules/es6.object.keys core-js/modules/es6.object.prevent-extensions core-js/modules/es6.object.seal core-js/modules/es6.object.set-prototype-of core-js/modules/es6.promise core-js/modules/es6.reflect.apply core-js/modules/es6.reflect.construct core-js/modules/es6.reflect.define-property core-js/modules/es6.reflect.delete-property core-js/modules/es6.reflect.get core-js/modules/es6.reflect.get-own-property-descriptor core-js/modules/es6.reflect.get-prototype-of core-js/modules/es6.reflect.has core-js/modules/es6.reflect.is-extensible core-js/modules/es6.reflect.own-keys core-js/modules/es6.reflect.prevent-extensions core-js/modules/es6.reflect.set core-js/modules/es6.reflect.set-prototype-of core-js/modules/es6.regexp.constructor core-js/modules/es6.regexp.flags core-js/modules/es6.regexp.match core-js/modules/es6.regexp.replace core-js/modules/es6.regexp.search core-js/modules/es6.regexp.split core-js/modules/es6.regexp.to-string core-js/modules/es6.set core-js/modules/es6.string.anchor core-js/modules/es6.string.big core-js/modules/es6.string.blink core-js/modules/es6.string.bold core-js/modules/es6.string.code-point-at core-js/modules/es6.string.ends-with core-js/modules/es6.string.fixed core-js/modules/es6.string.fontcolor core-js/modules/es6.string.fontsize core-js/modules/es6.string.from-code-point core-js/modules/es6.string.includes core-js/modules/es6.string.italics core-js/modules/es6.string.iterator core-js/modules/es6.string.link core-js/modules/es6.string.raw core-js/modules/es6.string.repeat core-js/modules/es6.string.small core-js/modules/es6.string.starts-with core-js/modules/es6.string.strike core-js/modules/es6.string.sub core-js/modules/es6.string.sup core-js/modules/es6.symbol core-js/modules/es6.typed.array-buffer core-js/modules/es6.typed.float32-array core-js/modules/es6.typed.float64-array core-js/modules/es6.typed.int16-array core-js/modules/es6.typed.int32-array core-js/modules/es6.typed.int8-array core-js/modules/es6.typed.uint16-array core-js/modules/es6.typed.uint32-array core-js/modules/es6.typed.uint8-array core-js/modules/es6.typed.uint8-clamped-array core-js/modules/es6.weak-map core-js/modules/es6.weak-set core-js/modules/es7.array.includes core-js/modules/es7.object.define-getter core-js/modules/es7.object.define-setter core-js/modules/es7.object.entries core-js/modules/es7.object.get-own-property-descriptors core-js/modules/es7.object.lookup-getter core-js/modules/es7.object.lookup-setter core-js/modules/es7.object.values core-js/modules/es7.promise.finally core-js/modules/es7.string.pad-end core-js/modules/es7.string.pad-start core-js/modules/es7.symbol.async-iterator core-js/modules/web.dom.iterable
and ending in:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend#0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend#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! /root/.npm/_logs/2020-03-24T05_31_56_496Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
I tried running npm's suggestion, which resulted in:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "core-js/modules/es6.array.copy-within" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/orb/.npm/_logs/2020-03-24T05_44_47_462Z-debug.log
I'm quite confused. I'm not sure how I'm missing core-js modules because the last time I ran the build (a couple of days ago), I had not issues. Any idea what's going on here?
Dockerfile:
FROM node:lts-alpine as updraft-frontend-build-stage
#install http server
RUN npm install -g http-server
#make app folder in current directory
WORKDIR /app
#copy package.json and package-lock.json
COPY package*.json ./
#install project dependencies
RUN npm install
#copy in project files & folders
COPY . .
#build app with minification
RUN npm run build
# EXPOSE 8080
# CMD ["http-server", "dist"]
#production stage
FROM nginx:stable-alpine as updraft-frontend-production-stage
COPY --from=updraft-frontend-build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Update:
Tried running the docker build without the cached layers, but no luck there either.
NPM won't install the missing files because they're part of core-js. running
npm i -S core-js#2.5.7
did the trick.
This thread has a few alternative options if you're interested:
Module not found: Error: Can't resolve 'core-js/es6'

Heroku Build Fail [sh: 1: react-scripts: Permission denied]

----> Node.js app detected
-----> 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.13.0...
Using default npm version: 6.12.0
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> nodemon#1.19.3 postinstall /tmp/build_33db88ab97938128199a401d17366aac/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
//REMOVED INSTALLATION TEXT HERE DUE TO CHAR LIMIT
-----> Build
Running heroku-postbuild
> website_setup#1.0.0 heroku-postbuild /tmp/build_33db88ab97938128199a401d17366aac
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
audited 905041 packages in 14.447s
found 1 moderate severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
> client#0.1.0 build /tmp/build_33db88ab97938128199a401d17366aac/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.1egfD/_logs/2019-11-08T01_04_59_454Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! website_setup#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 website_setup#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.1egfD/_logs/2019-11-08T01_04_59_470Z-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_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
Synopsis:
I recently finished MERN stack course and went to go push my build to Heroku but encountered the error above. I first thought it was a visual studio permissions error so I ran vs code with elevated privileges. This, however, did not work.
I've tried and had no success with:
Adding a nodejs script build package to my deployment
Modifying my package.json to incorporate engine which selects the version of node.js to run
Adding .js extensions to the end of the server in the scripts section thinking there may be a simple issue with that
Double checking that my local instance works properly (it does)
Promptly throwing my computer out my window (feels pretty good, but still not working)
Refer to this link to see how to check your file for the correct permissions and how to set them ( Updating file permissions with git-bash on Windows 7 )
sh: 1: react-scripts: Permission denied
So this is a permission issue. Go to the correct path that contains a react-scripts and do a chmod +x react-scripts will solve this issue.
I took a look at you GitHub repo and it seems to be a simple typo in your .gitignore file :
node_module/
config/default.json
And this should be :
node_modules/
config/default.json
Notice the name of node_modules folder ,so a quick fix would be to edit you .gitignore file and put the wright name , then run the following :
git rm -r --cached node_modules
delete node_modules in root directory as well in client/
git commit -am 'ignore node_modules'
And finally push your changes , this should fix the error .
check your package.json => React-script-->
step = 1==> "react-scripts": "(change_currend_version)"
Ex: "react-scripts": "1.0.1" change ==>"react-scripts": "3.4.3"
step = 2==> install ==> npm i
step = 3 ==> npm start

Node.Js and Socket.IO application on Heroku

I am having this error message when I try to deploy my application on Heroku. Any suggestions? I can easily deploy my app on localhost but it doesn't work on Heroku.
My Package.JSON is:
{
"name":"tryout",
"version":"0.0.1",
"private":true,
"scripts":{
"start":"node app"
},
"dependencies":{
"express":"3.0.0rc3",
"jade":"*",
"passport":">= 0.1.11",
"passport-local":">= 0.1.3",
"underscore":">= 1.3.3",
"socket.io":">= 0.9.6",
"node-uuid":">= 1.3.3",
"mongoose":">= 3.0.2",
"bcrypt":">= 0.7.1"
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
PS: I don't use hiredis at all.
Input command is: git push heroku master
Counting objects: 1731, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1541/1541), done.
Writing objects: 100% (1731/1731), 7.42 MiB | 400 KiB/s, done.
Total 1731 (delta 192), reused 0 (delta 0)
-----> Removing .DS_Store files
-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.8.14
Using npm version: 1.1.65
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm WARN package.json socket-app#0.0.1 No README.md file found!
npm WARN package.json jade#0.27.2 No README.md file found!
> hiredis#0.1.14 preinstall /tmp/build_37k5gxae7u8vc/node_modules/hiredis
> make || gmake
cd deps/hiredis && make static
make[1]: Entering directory `/tmp/build_37k5gxae7u8vc/node_modules/hiredis/deps/hiredis'
make[1]: Nothing to be done for `static'.
make[1]: Leaving directory `/tmp/build_37k5gxae7u8vc/node_modules/hiredis/deps/hiredis'
node-waf configure build
Setting srcdir to : /tmp/build_37k5gxae7u8vc/node_modules/hiredis
Setting blddir to : /tmp/build_37k5gxae7u8vc/node_modules/hiredis/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /tmp/node-node-jj2B
'configure' finished successfully (0.056s)
Waf: Entering directory `/Users/USERNAME/Developer/Sites/bla/node_modules/hiredis/build'
Waf: Leaving directory `/Users/USERNAME/Developer/Sites/bla/node_modules/hiredis/build'
Traceback (most recent call last):
File "/tmp/node-node-jj2B/bin/node-waf", line 16, in <module>
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/tmp/node-node-jj2B/bin/../lib/node/wafadmin/Build.py", line 268, in compile
os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/Users/USERNAME/Developer/Sites/bla/node_modules/hiredis/build'
make: *** [all] Error 1
sh: gmake: not found
npm ERR! hiredis#0.1.14 preinstall: `make || gmake`
npm ERR! `sh "-c" "make || gmake"` failed with 127
npm ERR!
npm ERR! Failed at the hiredis#0.1.14 preinstall script.
npm ERR! This is most likely a problem with the hiredis package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make || gmake
npm ERR! You can get their info via:
npm ERR! npm owner ls hiredis
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-347-ec2
npm ERR! command "/tmp/node-node-jj2B/bin/node" "/tmp/node-npm-nN2P/cli.js" "install" "--production"
npm ERR! cwd /tmp/build_37k5gxae7u8vc
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_37k5gxae7u8vc/npm-debug.log
npm ERR! not ok code 0
! Failed to install --production dependencies with npm
! Heroku push rejected, failed to compile Node.js app
To git#heroku.com:arcane-sea-8207.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:arcane-sea-8207.git'
It seems hiredis is indirectly needed by express, which you have a release candidate version, which might be the problem. Try to change express to:
"express":"3.x"
Also, make sure you don't commit the node_modules directory to your git repo. Add it to .gitignore!

Categories