Comments (28)
Im using openshift with node.js 10
if my NODE_EVN is production than I get this:
| │ npm update check failed │
| │ Try running with sudo or get access │
| │ to the local update config store via │
| │ sudo chown -R
else, if my NODE_ENV defined as development than I get that:
npm ERR! path /opt/app-root/src/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/opt/app-root/src/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
I played a lot with the pods, builds and etc.. didnt work
https://github.com/NatalyShv/Roomates
this is my POC repo that I try to launch on openshift @lance
from centos7-s2i-nodejs.
@lincolnthree by default, we do a "production" install, which doesn't install devDepencies
If you add NODE_ENV=development
to your deploy, it will install dev dependecies during deployment
or move those devDepencies to regular dependencies
from centos7-s2i-nodejs.
Hey @lholmquist ! Thanks. I actually just tried that and got a little farther (Yay!), but it's failing to install dependencies because there's no FS access now:
npm ERR! path /opt/app-root/src/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/opt/app-root/src/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/opt/app-root/src/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
from centos7-s2i-nodejs.
Ideas about this one?
from centos7-s2i-nodejs.
I see it's already running as root user, so not sure what's happening:
+ echo -e 'Running as user uid=1000140000 gid=0(root) groups=0(root),1000140000'
--
| + '[' true == true ']'
| + echo 'Installing dev dependencies...'
| + npm install
from centos7-s2i-nodejs.
Full log:
+ export GIT_COMMITTER_NAME=unknown
+ GIT_COMMITTER_NAME=unknown
+ export and [email protected]
+ [email protected]
+ git --version
git version 2.9.3
+ '[' '' == --debug ']'
+ run_node
+ echo -e 'Environment: \n\tDEV_MODE=true\n\tNODE_ENV=development\n\tDEBUG_PORT=5858'
Environment:
DEV_MODE=true
NODE_ENV=development
DEBUG_PORT=5858
++ id
+ echo -e 'Running as user uid=1000140000 gid=0(root) groups=0(root),1000140000'
+ '[' true == true ']'
+ echo 'Installing dev dependencies...'
+ npm install
Running as user uid=1000140000 gid=0(root) groups=0(root),1000140000
Installing dev dependencies...
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm http fetch GET 200 https://registry.npmjs.org/rhoaster 170ms
npm http fetch GET 200 https://registry.npmjs.org/nodeshift 180ms
npm http fetch GET 200 https://registry.npmjs.org/openshift-config-loader 52ms
npm http fetch GET 200 https://registry.npmjs.org/openshift-rest-client 53ms
npm http fetch GET 200 https://registry.npmjs.org/yargs 38ms
npm http fetch GET 200 https://registry.npmjs.org/openshift-rest-client/-/openshift-rest-client-1.1.1.tgz 42ms
npm http fetch GET 200 https://registry.npmjs.org/openshift-config-loader 94ms
npm http fetch GET 200 https://registry.npmjs.org/git-repo-info 99ms
npm http fetch GET 200 https://registry.npmjs.org/cliui 50ms
npm http fetch GET 200 https://registry.npmjs.org/js-yaml 116ms
npm http fetch GET 200 https://registry.npmjs.org/find-up 52ms
npm http fetch GET 200 https://registry.npmjs.org/chalk 126ms
npm http fetch GET 200 https://registry.npmjs.org/os-locale 53ms
npm http fetch GET 200 https://registry.npmjs.org/string-width 55ms
npm http fetch GET 200 https://registry.npmjs.org/openshift-rest-client 159ms
npm http fetch GET 200 https://registry.npmjs.org/rimraf 159ms
npm http fetch GET 200 https://registry.npmjs.org/which-module 59ms
npm http fetch GET 200 https://registry.npmjs.org/tar 168ms
npm http fetch GET 200 https://registry.npmjs.org/yargs-parser 65ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 68ms
npm http fetch GET 200 https://registry.npmjs.org/esprima 67ms
npm http fetch GET 304 https://registry.npmjs.org/string-width 81ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/ansi-styles 56ms
npm http fetch GET 200 https://registry.npmjs.org/locate-path 64ms
npm http fetch GET 200 https://registry.npmjs.org/supports-color 55ms
npm http fetch GET 200 https://registry.npmjs.org/execa 52ms
npm http fetch GET 200 https://registry.npmjs.org/mem 64ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 64ms
npm http fetch GET 200 https://registry.npmjs.org/fs-minipass 60ms
npm http fetch GET 200 https://registry.npmjs.org/chownr 66ms
npm http fetch GET 200 https://registry.npmjs.org/glob 74ms
npm http fetch GET 200 https://registry.npmjs.org/minipass 70ms
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 62ms
npm http fetch GET 200 https://registry.npmjs.org/minizlib 68ms
npm http fetch GET 200 https://registry.npmjs.org/yallist 56ms
npm http fetch GET 200 https://registry.npmjs.org/camelcase 49ms
npm http fetch GET 200 https://registry.npmjs.org/p-locate 47ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 55ms
npm http fetch GET 200 https://registry.npmjs.org/has-flag 41ms
npm http fetch GET 200 https://registry.npmjs.org/path-exists 44ms
npm http fetch GET 200 https://registry.npmjs.org/cross-spawn 46ms
npm http fetch GET 200 https://registry.npmjs.org/get-stream 46ms
npm http fetch GET 200 https://registry.npmjs.org/npm-run-path 45ms
npm http fetch GET 200 https://registry.npmjs.org/p-finally 44ms
npm http fetch GET 200 https://registry.npmjs.org/strip-eof 44ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-fn 40ms
npm http fetch GET 200 https://registry.npmjs.org/p-limit 32ms
npm http fetch GET 200 https://registry.npmjs.org/shebang-command 23ms
npm http fetch GET 200 https://registry.npmjs.org/path-key 28ms
npm http fetch GET 200 https://registry.npmjs.org/p-try 22ms
npm http fetch GET 200 https://registry.npmjs.org/shebang-regex 21ms
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
npm WARN checkPermissions Missing write access to /opt/app-root/src/node_modules
npm WARN [email protected] requires a peer of @angular/core@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/router@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! path /opt/app-root/src/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/opt/app-root/src/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/opt/app-root/src/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/opt/app-root/src/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
┌───────────────────────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /opt/app-root/src/.config │
└───────────────────────────────────────────────────────────────┘
npm ERR! A complete log of this run can be found in:
npm ERR! /opt/app-root/src/.npm/_logs/2018-05-17T17_57_31_287Z-debug.log
from centos7-s2i-nodejs.
from centos7-s2i-nodejs.
@lincolnthree I have been traveling a bit and will be able to spend more time on this soon, but for now, I have a suspicion about something. If you were to remove all of the artifacts from this project (deployment configs, build configs, builds, image streams, routes and services), then redeploy, does the problem still occur?
from centos7-s2i-nodejs.
Trying with a delete.
from centos7-s2i-nodejs.
It worked! Thanks @lance . Interesting. Why is this the case?
Also, I hope your talk went well today :)
from centos7-s2i-nodejs.
The view at that speaker's dinner looked.... stunning.
from centos7-s2i-nodejs.
@lincolnthree I haven't looked at your project to see exactly what you are doing, but here is my theory.
When you deploy an application more than once, the assemble
script tries to be smart and will use the node_modules
directory from previous installs in order to save on deployment time https://github.com/bucharest-gold/centos7-s2i-nodejs/blob/master/s2i/assemble#L42-L49. I think this might be the problem. And in spite of the fact that you are in the root
group (look closely at that line, you're not root
- just in the group), the permissions from the previous install seem to be insufficient. I will poke around with it more today after my talk and see what I can find.
My first talk yesterday went really well - thanks for asking!
from centos7-s2i-nodejs.
@lincolnthree since you had success after removing the previous build configuration and other artifacts, does the problem still occur when you try to rebuild?
from centos7-s2i-nodejs.
Checking...
from centos7-s2i-nodejs.
It fails with the same error. Interesting.
from centos7-s2i-nodejs.
@lincolnthree I took a look at your package.json and I have to say... that's a complicated build! Can you help me out by explaining how your build works - or even providing a simpler sample project where I can easily reproduce the error within a test case?
from centos7-s2i-nodejs.
@lance Yeah I'm simplifying it now. I forked from another project (Fabric8 launcher-frontend). I've been trying to cut out the stuff that's not necessary.
Basically just:
npm install
npm run build:prod
npm run start:prod
"build:prod": "webpack --config config/webpack.prod.js -p",
"start:prod": "node scripts/prod-server.js",
That's all that should be necessary.
from centos7-s2i-nodejs.
@lance I'm having some other strange issues now. E.g. the image no longer seems to respect my .s2i/environment file. It's running some other commands and I don't really know what or why.
E.g. It seems to run npm install again in the deployment of the final image. Even after it's already done that during the image build. And it's not calling my NPM_RUN=
(I know because I deleted the run script it references and it's still doing the same thing and not complaining.)
from centos7-s2i-nodejs.
@lance The s2I image build step just seems to run the npm install and then postinstall scripts. Nothing else.
from centos7-s2i-nodejs.
The strange part with that is I could swear it had been respecting this configuration before.
from centos7-s2i-nodejs.
Ah. Apparently after reading through the S2I scripts, NPM_RUN is only respected in "production" NODE_ENV... seems like it should be respected in "development" as well?
from centos7-s2i-nodejs.
@lincolnthree yeah, so in dev mode we run nodemon
which looks at the main
property in package.json. Can you try adding a main: scripts/prod_server.js
line in your package.json to see if that helps?
from centos7-s2i-nodejs.
@lincolnthree how are things with this?
from centos7-s2i-nodejs.
So far so good. I figured out how to use the BuildConfig env:
vars to control the node env for build vs. deploy. That seems to be the most reasonable solution. That said, I think there does need to be a way to configure nodemon
to target a script in the package.json, not main. As main.js is often used for specifying actual code entry points, not build entry points, right?
I think the conflation of building vs. deploying/releasing should be avoided, as that's already confusing as hell in node-land.
Thoughts?
from centos7-s2i-nodejs.
Closing as resolved, and opening a new issue regarding documentation - referencing #94
from centos7-s2i-nodejs.
@lincolnthree I have been traveling a bit and will be able to spend more time on this soon, but for now, I have a suspicion about something. If you were to remove all of the artifacts from this project (deployment configs, build configs, builds, image streams, routes and services), then redeploy, does the problem still occur?
saw this issue and had the same problem (include first step that worked for both of us) but the:
EACCES: permission denied, access '/opt/app-root/src/node_modules' npm openshift
still occures to me, even when I delete it all..
any ideas?
@lance
from centos7-s2i-nodejs.
@OfekRv what version are you using
from centos7-s2i-nodejs.
the same error as @OfekRv has
from centos7-s2i-nodejs.
Related Issues (20)
- Review / update CI config. HOT 1
- run `npm build` during assemble? HOT 2
- Update the doc to include the backport to master and publish the latest HOT 1
- To keep the publishing guide updated only on master branch ? HOT 1
- Investigate alternative ways to install debuginfo
- Investigate a better way to run npm build HOT 1
- node version 8.12.0 does "npm install -s --only=production" HOT 5
- check for "build" script, should also test for the existence of scripts HOT 2
- 8x update the sources to nodeshift github organization
- 10x update the sources to nodeshift organization
- 11x update the sources to nodeshift organization
- branch master: update to nodeshift organization
- squashed image is larger than original
- git-remote-https: error while loading shared libraries: libcurl-httpd24.so.4
- Wrong git tags HOT 3
- Support for webpack-dev-server in development mode HOT 2
- Yarn should be installed during s2i assemble phase HOT 2
- Consider moving this CI over to CircleCI instead of Travis-CI HOT 1
- Source Repo from Tutorial gone? HOT 1
- Red Hat uses this by default, so how can it be deprecated? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from centos7-s2i-nodejs.