skip to Main Content

I Installed laravel 5.7 app in docker and when I entered the shell and run

npm run watch-poll 

command I got error :

npm does not support Node.js v13.0.0-pre

docker-compose.yml has

version: '3.1'

web/Dockerfile.yml :

FROM php:7.2-apache

RUN apt-get update && 
    apt-get install -y 
    python 
    libfreetype6-dev 
    libwebp-dev 
    libjpeg62-turbo-dev 
    libpng-dev 
    nano 
    git-core 
    curl 
    build-essential 
    openssl 
    libssl-dev 
    libgmp-dev 
    libldap2-dev 
    netcat 
    sqlite3 
    libsqlite3-dev 
     && git clone https://github.com/nodejs/node.git 
     && cd node 
     && ./configure 
     && make 
     && make install

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/


  RUN  docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif 
&& a2enmod rewrite

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

Full output in the console :

$ docker-compose exec web bash
root@48dc23ea4799:/var/www/html# npm -v
6.11.3
root@48dc23ea4799:/var/www/html# node -v
v13.0.0-pre
root@48dc23ea4799:/var/www/html# uname -a
Linux 48dc23ea4799 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 GNU/Linux
root@48dc23ea4799:/var/www/html# npm run watch-poll
npm WARN npm npm does not support Node.js v13.0.0-pre
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

> @ watch-poll /var/www/html
> npm run watch -- --watch-poll

npm WARN npm npm does not support Node.js v13.0.0-pre
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

> @ watch /var/www/html
> npm run development -- --watch "--watch-poll"

npm WARN npm npm does not support Node.js v13.0.0-pre
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

> @ development /var/www/html                                                                                                                                                                                                                
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"                                                            

sh: 1: cross-env: not found                                                                                                                                                                                                                  
npm ERR! code ELIFECYCLE                                                                                                                                                                                                                     
npm ERR! syscall spawn                                                                                                                                                                                                                       
npm ERR! file sh                                                                                                                                                                                                                             
npm ERR! errno ENOENT                                                                                                                                                                                                                        
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`                                    
npm ERR! spawn ENOENT                                                                                                                                                                                                                        
npm ERR!                                                                                                                                                                                                                                     
npm ERR! Failed at the @ development script.                                                                                                                                                                                                 
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.                                                                                                                                           
npm WARN Local package.json exists, but node_modules missing, did you mean to install?                                                                                                                                                       

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-13T14_41_04_451Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-13T14_41_04_473Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-13T14_41_04_499Z-debug.log

If there is a way with command

git clone https://github.com/nodejs/node.git

to install 12 node verion?
Or some other decision ?

MODIFIED :

I tried to install cross-env, but got error :

 # npm install cross-env
npm WARN npm npm does not support Node.js v13.0.0-pre
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

> [email protected] install /var/www/html/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/linux-x64-79_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/linux-x64-79_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> [email protected] postinstall /var/www/html/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall /var/www/html/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /var/www/html/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/var/www/html/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.16
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 13.0.0-pre
gyp verb command install [ '13.0.0-pre' ]
gyp verb install input version string "13.0.0-pre"
gyp verb detected "pre" node version 13.0.0-pre
gyp ERR! configure error 
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack     at install (/var/www/html/node_modules/node-gyp/lib/install.js:70:16)
gyp ERR! stack     at exports (/var/www/html/node_modules/node-gyp/lib/install.js:2:10)
gyp ERR! stack     at Object.self.commands.<computed> [as install] (/var/www/html/node_modules/node-gyp/lib/node-gyp.js:55:37)
gyp ERR! stack     at getNodeDir (/var/www/html/node_modules/node-gyp/lib/configure.js:79:20)
gyp ERR! stack     at PythonFinder.callback (/var/www/html/node_modules/node-gyp/lib/configure.js:44:7)
gyp ERR! stack     at PythonFinder.<anonymous> (/var/www/html/node_modules/node-gyp/lib/configure.js:471:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:286:7)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1028:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:430:11)
gyp ERR! System Linux 4.15.0-65-generic
gyp ERR! command "/usr/local/bin/node" "/var/www/html/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/html/node_modules/node-sass
gyp ERR! node -v v13.0.0-pre
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN You are using a pre-release version of node and things may not work as expected
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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/2019-10-14T03_42_11_550Z-debug.log

I have

HTTP error 404 Not Found

As I am in docker ?

Have I to add 1 more RUN command :

  **&& git clone https://github.com/nodejs/node.git 
    && cd node 
    && git checkout v12.0.0

    && ./configure 
     && make 
     && make install

  RUN npm install cross-env

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/**

?

2

Answers


  1. npm does not support Node.js v13.0.0-pre
    is just warring

    the real error might be this

    sh: 1: cross-env: not found  
    
    Login or Signup to reply.
  2. As mentioned by @Daniel cross-env is missing.

    But if you want to install node12 then you can need to add these in your Docekrfile.

    RUN git clone https://github.com/nodejs/node.git && 
         && cd node 
         && git checkout v12.0.0
         && ./configure 
         && make 
         && make install
    # better to intall packages it build time
    RUN npm install --global cross-env watch-poll
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search