Azure / azure-functions-pack

Easily package your Node.js Functions for Azure Functions
MIT License
153 stars 31 forks source link

npm install from anywhere but registry doesn't work. #66

Closed joseph-cloudthing closed 6 years ago

joseph-cloudthing commented 6 years ago

From the registry, all fine:

>npm install azure-functions-pack@0.3.1
npm WARN ICAEW-chatbot@1.0.0 No repository field.
npm WARN ICAEW-chatbot@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ azure-functions-pack@0.3.1
added 8 packages and removed 4 packages in 8.756s

From any other possible location, I get a failure at the same point. e.g. git:

>npm install git+https://github.com/Azure/azure-functions-pack.git#0.3.1
npm WARN ICAEW-chatbot@1.0.0 No repository field.
npm WARN ICAEW-chatbot@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path C:\Users\JosephPrice\git\ChatBot\node_modules\azure-functions-pack\lib\main.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\JosephPrice\git\ChatBot\node_modules\azure-functions-pack\lib\main.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\JosephPrice\AppData\Roaming\npm-cache\_logs\2018-01-23T11_40_48_432Z-debug.log

This is the same when pointing at tar.gz's etc.

I'm new to node, but I'm not having this issue when installing from git or tar.gz with any other package I try.

christopheranderson commented 6 years ago

by design

This is because I don't have the .js source checked in, I'm using TypeScript. If you run "npm build" (and you might need to run "npm install" again to include my dev dependencies), then it would generate the .js output when you install from JS.

christopheranderson commented 6 years ago

I could theoretically have a "install" script which would detect if the .js source is installed and then install it. Not sure if that's a common pattern.

Question: Why are you trying to npm install from github and not NPM?

joseph-cloudthing commented 6 years ago

Hey @christopheranderson I was just hoping to install azure-functions-pack from a branch quickly to test possible fixes. Checking out building/installing isn't a deal breaker, was just annoying :)

Don't worry about closing if it's not important!

christopheranderson commented 6 years ago

It's not so much that it's not important. It's that I don't want to check in generated files, I feel that that is generally a bad practice.

The work to make installing from github isn't trivial, so if you don't mind, I'll just close this as won't fix for now. Thanks.

joseph-cloudthing commented 6 years ago

Definitely makes perfect sense.