Foundation watch throws gulp errors - gulp

I messed up my local project with Foundation 6 but I had everything on a remote web server so I downloaded my project to a local folder. When I tried to run foundation watch I got errors
sh: /myfolder/node_modules/.bin/gulp: Permission denied
Error: foundation-sites-template#1.0.0 start: `gulp`
Exit status 126
at EventEmitter.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/lifecycle.js:217:16)
at emitTwo (events.js:100:13)
at EventEmitter.emit (events.js:185:7)
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/spawn.js:24:14)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
Is that fixable?

Whatever means of copying you used probably messed up the executable bit of /myfolder/node_modules/.bin/gulp. Type the following in a terminal:
chmod a+x /myfolder/node_modules/.bin/gulp
There might be other files with permission issues, so it's probably best to just delete the the whole node_modules folder and npm install from scratch.

Related

when use this library :----- react-native-tesseract-ocr

D:\OCR2>npm run android
OCR2#0.0.1 android
react-native run-android
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
at makeError (D:\OCR2\node_modules\execa\index.js:174:9)
at D:\OCR2\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\OCR2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\OCR2\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
D:\OCR2> npm i rn-text-detector --save
added 1 package, and audited 974 packages in 3s
102 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
D:\OCR2>npm run android --warning-mode=all
OCR2#0.0.1 android
react-native run-android
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
at makeError (D:\OCR2\node_modules\execa\index.js:174:9)
at D:\OCR2\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\OCR2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\OCR2\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
D:\OCR2>
i found a soluation
android/build.gradle
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlinVersion = "1.5.31" //use this line -----------
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}

Unexpected end of json when installing npm package

Im trying to run npm install on ng2-smart-table. It looks like its having trouble getting some of the modules. Im getting the following error.
npm ERR! Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tommie/.npm/_logs/2018-05-15T14_32_04_066Z-debug.log
Tommies-MacBook-Pro:ng2-smart-table tommie$ vi /Users/tommie/.npm/_logs/2018-05-15T14_32_04_066Z-debug.log
Tommies-MacBook-Pro:ng2-smart-table tommie$ rm package-lock.json
rm: package-lock.json: No such file or directory
When I look at the log I get the following
<snip>
4508 silly pacote range manifest for http-proxy-middleware#~0.17.4 fetched in 16ms
4509 silly resolveWithNewModule http-proxy-middleware#0.17.4 checking installable status
4510 silly pacote version manifest for sockjs#0.3.18 fetched in 16ms
4511 silly resolveWithNewModule sockjs#0.3.18 checking installable status
4512 silly pacote version manifest for sockjs-client#1.1.2 fetched in 17ms
4513 silly resolveWithNewModule sockjs-client#1.1.2 checking installable status
4514 silly pacote range manifest for yargs#^6.0.0 fetched in 3ms
4515 silly resolveWithNewModule yargs#6.6.0 checking installable status
4516 http fetch GET 304 https://registry.npmjs.org/spdy 33ms (from cache)
4517 silly fetchPackageMetaData error for spdy#^3.4.1 Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4518 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4518 verbose stack at JSON.parse (<anonymous>)
4518 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-better-errors/index.js:7:17)
4518 verbose stack at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:96:50)
4518 verbose stack at <anonymous>
4518 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
4519 verbose cwd /Users/tommie/dev/ng2-smart-table
4520 verbose Darwin 15.6.0
4521 verbose argv "/usr/local/Cellar/node/8.2.1/bin/node" "/usr/local/bin/npm" "install"
4522 verbose node v8.2.1
4523 verbose npm v5.4.0
4524 error Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4525 verbose exit [ 1, true ]
Any suggestions would be appreciated.
I got the same error and on searching I found out I needed to clear the npm cache first, did and it worked.
first run the following command:
npm cache clean --force
And then run that react-native command, it will work hopefully.

can polymer-cli#next damaged somehow polymer 1

Until I started the new polymer-cli my projects done in Polymer 1 was running as expected. Now, when I tried to start them via gulp serve I get error.
I tried updated by "bower update" and I got
bower polymer#1.11.3 ENOENT ENOENT: no such file or directory, lstat 'C:\Users\my-user\AppData\Local\Temp\tmp-28649quOp0xfcp3e\polymer-1.11.3'
Stack trace:
C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\fstream\lib\dir-reader.js:96:25
C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\graceful-fs\polyfills.js:284:29
FSReqWrap.oncomplete (fs.js:152:21)
Console trace:
Error
at StandardRenderer.error (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\renderers\StandardRenderer.js:88:37)
at Logger.<anonymous> (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\bin\bower.js:113:30)
at emitOne (events.js:116:13)
at Logger.emit (events.js:211:7)
at Logger.emit (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\bower-logger\lib\Logger.js:29:39)
at C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\commands\index.js:49:24
at _rejected (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\q\q.js:864:24)
at C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\q\q.js:890:30
at Promise.when (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\my-user\AppData\Roaming\npm\node_modules\bower\lib\node_modules\q\q.js:808:41)
System info:
Bower version: 1.8.4
Node version: 8.11.1
OS: Windows_NT 6.1.7601 x64
Could that be related to the fact I installed "npm install -g polymer-cli#next"? What could I check around?

NetLify CMS - gulpe server error due to missing ./bin/hugo.win32 file

I am testing NetLify CMS for a project, but I am not able to work in my local environment, because gulp server crashs before it start, due to the error below:
$ npm start
> victor-hugo#1.0.0 start C:\Users\maufa\Documents\web-development\kaldi-hugo-cms-template
> gulp server
[14:17:07] Requiring external module babel-register
[14:17:08] Using gulpfile ~\Documents\web-development\kaldi-hugo-cms-template\gulpfile.babel.js
[14:17:08] Starting 'hugo'...
[14:17:08] Starting 'css'...
[14:17:09] Starting 'js'...
[14:17:09] Starting 'svg'...
[14:17:09] Starting 'cms'...
[14:17:09] Finished 'cms' after 150 ms
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn ./bin/hugo.win32 ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! victor-hugo#1.0.0 start: `gulp server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the victor-hugo#1.0.0 start script 'gulp server'.
So, looks like it is trying to find hugo.win32 inside the bin folder.
However, inside this folder I ave:
hugo.darwin
hugo.exe
hugo.linux
Any clue?
It looks like this issue is particular to the Kaldi Hugo template. I installed on Windows and got the same error, then I tried renaming hugo.exe to hugo.win32, and it worked. I found the error in gulpfile.babel.js (incorrect string identifier for Windows), and submitted a PR. If you don't want to wait for the merge, feel free to change your version directly: https://github.com/netlify-templates/kaldi-hugo-cms-template/pull/3/files

Jekyll in gulp fails at win32

I worked on a stationary computer with a 64-bit system - everything was alright.
Now I decided to work on the tablet with a 32-bit system. Moved all project files (without folder node_modules), installed node.js, launched comand npm i, so in theory, all modules and dependencies should be established by themselves. Before that, of course, globally installed gulp-cli.
sass, jade, js are compiled without problems, which means, gulp and dependence correctly installed.
The problem is that I do not know why I have the error in jekyll task.
On the Internet, I found the solution by adding exec instead spawn to childprocess (child is childprocess in my gulpfile.js). Added - it solved one problem, but there was another error (the current error in question).
Also, some people have same error (as in my question) becouse they forgot to exclude from the jekyll compilation folder node_modules. But I rule it in _config.yml file:
exclude: ["node_modules", "gulpfile.js", "package.json"]
And it is not clear what the problem is.
Here is my task [jekyll], in which the error occurs:
var messages = {jekyllBuild: 'Running: $ jekyll build'};
gulp.task('jekyll-build', function (done) {
browserSync.notify(messages.jekyllBuild);
var pl = process.platform === "win32" ? "jekyll.bat" : "jekyll";
return child.exec(pl, ['build'], {stdio: 'inherit'}).on('close', done);
});
But the error itself:
[14:55:51] Using gulpfile C:\Web\vostoksisters\gulpfile.js
[14:55:51] Starting 'sync group0:0'...
[14:55:51] Starting 'jade'...
[14:55:51] Finished 'jade' after 44 ms
[14:55:51] Starting 'sass'...
[14:55:51] Starting 'js'...
[14:55:51] Finished 'js' after 6.95 ms
[14:55:53] Finished 'sass' after 2.06 s
[14:55:53] Finished 'sync group0:0' after 2.12 s
[14:55:53] Starting 'sync group0:1'...
[14:55:53] Starting 'jekyll-build'...
[14:55:53] 'jekyll-build' errored after 32 ms
[14:55:53] Error: 1
at formatError (C:\Users\reall\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:169:10)
at Gulp.<anonymous> (C:\Users\reall\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:195:15)
at emitOne (events.js:96:13)
at Gulp.emit (events.js:188:7)
at Gulp.Orchestrator._emitTaskDone (C:\Web\vostoksisters\node_modules\orchestrator\index.js:264:8)
at C:\Web\vostoksisters\node_modules\orchestrator\index.js:275:23
at finish (C:\Web\vostoksisters\node_modules\orchestrator\lib\runTask.js:21:8)
at ChildProcess.cb (C:\Web\vostoksisters\node_modules\orchestrator\lib\runTask.js:29:3)
at emitTwo (events.js:111:20)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)