2

I get this error in windows CMD:

> fastify-website@1.0.0 build:get-releases C:\Users\Karol\Desktop\wbs
> src/scripts/downloadReleases.js fastify/fastify build-temp/releases/ v0.11.0

'src' is not recognized as an internal or external command,
operable program or batch file.

My package.json:

"name": "fastify-website",
  "version": "1.0.0",
  "description": "A static website builder for metalsmith",
  "scripts": {
    "build:cleanup": "rimraf build-temp",
    "build:create-temp-folder": "mkdirp build-temp",
    "build:get-releases": "src/scripts/downloadReleases.js fastify/fastify build-temp/releases/ v0.11.0",

Description

so basically npm start works till it gets to script "build:get-releases"... I tried messing with package json but didnt help, also, the directory src/scripts/downloadReleases.js DOES exist.

Is it because it was written typically for linux and im using windows? Because im ready to install linux if its true, but i need confirmation

(PS i downloaded this straight from github and it should be working, so my assumption was linux can read this specific content of package.json file properly)

  • Assuming `src/scripts/downloadReleases.js` is a node script, what is the output if you add `node` it to like so: `node src/scripts/downloadReleases.js ...` – Jtaks Mar 05 '19 at 16:05
  • try replacing the "/" in paths by "\" for windows – Kaddath Mar 05 '19 at 16:06
  • thanks @Kaddath, that solved the issue, however im getting next error. i guess ill just install linux. thanks again i wouldnt find it on my own – PlzHelpMeSon Mar 05 '19 at 16:19

1 Answers1

1

Yes it is because you are not using linux.

Windows has no support for shebangs, which downloadReleases.js uses. You can see it on line 1:

#!/usr/bin/env node

That line tells the operating system where to find the proper interpreter for the script. A simple fix that you or the author could make would be to use the interpreter in the command like so:

node src/scripts/downloadReleases.js fastify/fastify build-temp/releases/ v0.11.0

This change would allow either windows and linux users to run the scripts as long as they have node installed.

Jtaks
  • 281
  • 2
  • 5
  • 13