rafhun / grunt-wordpress-starter

Boilerplate for Wordpress theme development run by Grunt using Sass, Susy, Linters
GNU General Public License v3.0
4 stars 0 forks source link

NPM install fails on setup.sh #18

Open tlartaud opened 8 years ago

tlartaud commented 8 years ago

Hi,

Running on host machine :

On guest (VM) :

Trying to run npm install on the host machine with a deleted node_modules folder

Thomas@Thomas-PC MINGW64 ~/Sites/busydev (master)
$ npm install

> grunt-wordpress-starter@1.7.0 install C:\Users\Thomas\Sites\busydev
> sh ./setup.sh

Running "prompt:themeName" (prompt) task
? Theme Name:  (werbelinie) busyless
? Theme Name:  busyless
? Root Folder:  wwwroot/
? Default WordPress Locale:  fr_FR

Running "replace:themeSetup" (replace) task
>> Unable to match 2 patterns.
>> 1 replacement in 1 file.

Done.

Execution Time (2016-06-28 16:27:01 UTC)
loading tasks     350ms  ███ 1%
prompt:themeName  24.9s  █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 98%
Total 25.4s

Running "replace:acfProKey" (replace) task
>> 1 replacement in 1 file.

Running "replace:themeName" (replace) task
>> Unable to match 1 pattern, remember for simple matches (String) we are using the prefix @@ for replacement lookup.
>> 0 replacements in 1 file.

Running "shell:updateRootPath" (shell) task
sed: can't read s=wwwroot/=wwwroot/=g: No such file or directory
Warning: Command failed: sed -i "" "s=wwwroot/=wwwroot/=g" composer.json wp-cli.yml .gitignore secrets.json secrets-template.json
sed: can't read s=wwwroot/=wwwroot/=g: No such file or directory
 Use --force to continue.

Aborted due to warnings.

Execution Time (2016-06-28 16:27:27 UTC)
loading tasks          232ms  ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 63%
loading grunt-replace   40ms  ███████████████████████ 11%
replace:acfProKey       12ms  ███████ 3%
replace:themeName        6ms  ████ 2%
loading grunt-shell      5ms  ███ 1%
shell:updateRootPath    76ms  ████████████████████████████████████████████ 20%
Total 371ms

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Thomas\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v5.11.0
npm ERR! npm  v3.10.2
npm ERR! code ELIFECYCLE
npm ERR! grunt-wordpress-starter@1.7.0 install: `sh ./setup.sh`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the grunt-wordpress-starter@1.7.0 install script 'sh ./setup.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grunt-wordpress-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     sh ./setup.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grunt-wordpress-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grunt-wordpress-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Thomas\Sites\busydev\npm-debug.log

Trying to running it on the guest machine


Thomas@Thomas-PC MINGW64 ~/Sites/busydev (master)
$ vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-55-generic x86_64)

 $$$$$$\   $$$$$$\   $$$$$$\ $$$$$$$$\  $$$$$$\  $$\   $$\
$$  __$$\ $$  __$$\ $$  __$$\\__$$  __|$$  __$$\ $$ |  $$ |
$$ /  \__|$$ /  \__|$$ /  $$ |  $$ |   $$ /  \__|$$ |  $$ |
\$$$$$$\  $$ |      $$ |  $$ |  $$ |   $$ |      $$$$$$$$ |
 \____$$\ $$ |      $$ |  $$ |  $$ |   $$ |      $$  __$$ |
$$\   $$ |$$ |  $$\ $$ |  $$ |  $$ |   $$ |  $$\ $$ |  $$ |
\$$$$$$  |\$$$$$$  | $$$$$$  |  $$ |   \$$$$$$  |$$ |  $$ |
 \______/  \______/  \______/   \__|    \______/ \__|  \__|

$$$$$$$\   $$$$$$\  $$\   $$\
$$  __$$\ $$  __$$\ $$ |  $$ |
$$ |  $$ |$$ /  $$ |\$$\ $$  |
$$$$$$$\ |$$ |  $$ | \$$$$  /
$$  __$$\ $$ |  $$ | $$  $$<
$$ |  $$ |$$ |  $$ |$$  /\$$\
$$$$$$$  | $$$$$$  |$$ /  $$ |
\_______/  \______/ \__|  \__|

For help, please visit box.scotch.io or scotch.io. Follow us on Twitter at @scotch_io and at @nickforthought.

Last login: Tue Jun 28 16:07:40 2016 from 10.0.2.2
vagrant@scotchbox:~$ cd /var/www
vagrant@scotchbox:/var/www$ node -v
v5.11.1
vagrant@scotchbox:/var/www$ npm -v
3.10.3
vagrant@scotchbox:/var/www$ grunt -V
grunt-cli v1.2.0
grunt v1.0.1
vagrant@scotchbox:/var/www$ npm install

> grunt-wordpress-starter@1.7.0 install /var/www
> sh ./setup.sh

./setup.sh: 2: [: -a: unexpected operator
Paste your ACF Pro Key here:
./setup.sh: 9: ./setup.sh: [[: not found
Writing the ACF Key to your secrets.json. Please do not put this key in a public repo.
sed: can't read s/@@acfProKey//g: No such file or directory
Killed

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
npm ERR! Linux 3.13.0-55-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.11.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! grunt-wordpress-starter@1.7.0 install: `sh ./setup.sh`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the grunt-wordpress-starter@1.7.0 install script 'sh ./setup.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grunt-wordpress-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     sh ./setup.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grunt-wordpress-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grunt-wordpress-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/npm-debug.log

All my files are checkout via git with LF line-endings : I edited the gitattribute files to have this

# source code
*.php text eol=lf
*.css text eol=lf
*.scss text e............

Any idea ?

tlartaud commented 8 years ago

I Just think that your scripts are not written to be executed from a Windows environment. Quotes and doubles quotes on windows lead to different behaviors than on Unix systems. You have to quote any argument on windows.

So this :

sed -i '' 's,"advanced-custom-fields/advanced-custom-fields-pro":,"wpackagist-plugin/advanced-custom-fields":,g' composer.json

Should become this :

sed -i 's,"advanced-custom-fields/advanced-custom-fields-pro":,"wpackagist-plugin/advanced-custom-fields":,g' 'composer.json'

also notice the first empty quote argument.. what is it ?

Anyway, it should probably work on unix systems, not on windows.

Best regards, good luck with your stack, I'm sad I couldn't test it, it looks awesome.

rafhun commented 8 years ago

Hey, thanks for your feedback. And yes, I am sorry, I do not at this time have the opportunity to test it out on Windows. Many things unfortunately are thus solved using Unix command line tools.

However I am currently working on moving the whole stack, or as much as possible, over to a docker environment which will hopefully solve many of the compatibility issues between OS's.