Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 5.4 / Laravel Mix Node.js version #48

Open
artemverbo opened this issue Jan 31, 2017 · 5 comments
Open

Laravel 5.4 / Laravel Mix Node.js version #48

artemverbo opened this issue Jan 31, 2017 · 5 comments

Comments

@artemverbo
Copy link

Hi there,

Tried to bump one of the projects to 5.4 and use the new Laravel recommended way of assets management (Laravel Mix, purely based on Webpack, with no Gulp at all).

Seems like that requires newer versions of node/npm than currently available here.

> @ dev /opt/atlassian/pipelines/agent/build
> node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
/opt/atlassian/pipelines/agent/build/node_modules/laravel-mix/setup/webpack.config.js:120
        let extractPlugin = new plugins.ExtractTextPlugin(
        ^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)

laravel-mix/laravel-mix#62

That's what I can currently see:

node v5.12.0
npm  v3.8.6

So assume it needs at least 6 and above...

@artemverbo
Copy link
Author

UPD: Fixed temporary by adding this as a step in bitbucket pipelines, but I believe currently used nodejs install could be replaced with that in the Dockerfile.

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs

@newbie2005
Copy link

W: GPG error: http://repo.mysql.com trusty InRelease: The following signatures were invalid: KEYEXPIRED 1487236823 KEYEXPIRED 1487236823 KEYEXPIRED 1487236823
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: Failed to fetch http://ppa.launchpad.net/rwky/redis/ubuntu/dists/trusty/main/binary-amd64/Packages 403 Forbidden

It throw above error

@newbie2005
Copy link

newbie2005 commented Oct 18, 2017

cd /etc/apt/source.list.d
rm mysql.list
rm nodesource.list
rm rwky-redis-trusty.list
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
fixed error and run
apt-get install -y nodejs

Installed
node v7.10.1
npm 4.2.0

@ninthday
Copy link

Thanks you @artemverbo and @newbie2005
I modified nodesource.list in /etc/apt/source.list.d

replace:

deb https://deb.nodesource.com/node_5.x trusty main
deb-src https://deb.nodesource.com/node_5.x trusty main

to

deb https://deb.nodesource.com/node_8.x trusty main
deb-src https://deb.nodesource.com/node_8.x trusty main

then apt-get update && apt-get install -y nodejs.

node v8.9.1
npm 5.5.0

@mrdenis73
Copy link

Can be in the repository a file package-lock.json? Different versions on different servers.
There was a similar problem with the version node and npm tried different. The Laravel mix module did not take the necessary dependencies.
screenshots GitlabCI
http://joxi.ru/Y2LpgKnf9PQY32
http://joxi.ru/l2Znal0FwPEX82 - not laravel-mix dependencies
http://joxi.ru/brREVQ7fJPYD7A
(There are no modules in the folder)
remove package-lock.json
http://joxi.ru/a2XadKMC1BD3QA good (latest version node and npm).

Maybe you have this same stupid mistake. It is necessary to work with the same versions, but there are also such situations.

Could not compile the script on the servers (the old OP, the node required a new gcc, and that required a bunch of dependencies, the old node and npm did not work), they started using gitlab ci. Tried to run on local windows, linux mint, linux ubunta - all is well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants