Like this question How to import private Azure repo into a project via HTTPS? I'm trying import a repository like a dependency inside the package.json in another project.
This answer https://stackoverflow.com/a/61906140/8468940 seems to be good but I couldn't make it work.
When I tried this way
"commons-js": git#ssh.dev.azure.com:v3/tiagoaleff/commons-js/commons-js
I got the following response:
Could not install from "git#ssh.dev.azure.com:v3\tiagoaleff\commons-js\commons-js" as it does not contain a package.json file.
But I have a package.json in my commons-js. I also tried another ways and urls but without success.
I also tried this way:
git+ssh://account#ssh.visualstudio.com:v3/tiagoaleff/commons-js/commons-js
But after some time I got this error:
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128
Unfortunately I'm in trial and error mode. I don't know If in the company I can use the pipelines and I don't know have experience with this process.
Maybe this approach isn't enable? Or maybe, is pipeline the only solution?
Thanks you guys for your patience and sorry by my English.
Related
I have encountered a problem with npm which gives me this weird error.
It seems the error is not related to a specific file, but it is something that occurs for some reason. Unfortunately I can't share any code, but after a research I found it has something to do with cache (maybe?). The process is happening on a kubernetes pod with different environments for multiple npm/nodejs installations running in parallel.
Has anybody encountered this problem or has more details and information on the matter?
Will update the post accordingly, thank you.
I tried to fork this react native module to make some corrections, because the author abandoned the project and he was the only tool I found and meets my need, so reading an article I found out about the fork, I did this procedure, then I cloned and did necessary correction, only when having to add the module to my react project with the
yarn add lucassouza16/react-native-svg-uri
I get this error:
error Couldn't find the binary git
I'm new to this forking function, is there anything else I need to do?
My bifurcated repository:
https://github.com/lucassouza16/react-native-svg-uri
Original repository:
https://github.com/vault-development/react-native-svg-uri
To add it via npm or yarn you will need to add this firstly to npm registry. Here you have more information about it https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry
You can also add via github doing like this:
yarn add git+https://github.com/lucassouza16/react-native-svg-uri.git
You can read more about it here:
How to install an npm package from GitHub directly?
In the end all responses resulted in the same error, yet thanks to everyone who tried to help me, but it worked when I added the release version, this is the correct format:
yarn add lucassouza16/react-native-svg-uri#1.2 .4
My NPM install step is configured to use registries in .npmrc,
My .npmrc is as follows
registry=https://pkgs.dev.azure.com/xxx/xxxx-xxxx-xxxx/_packaging/design-system/npm/registry/
always-auth=true
The Azure Artifacts feed is set-up, and a local npm install from my dev machine works completely fine.
However the pipeline's npm install job always fails with error 403.
What am I doing wrong here? I've also tried changing the npm install task to use Registry I select here, and linking it to my "design-system" feed directly, but it results in the same error. I've followed all the steps here https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows, but it just doesn't work. Thanks
Problem solved. What I had to do was go under into the feed -> settings -> permissions, and add the ...Build Service... as a Contributor.
Microsoft should really add this as part of their documentation. Took me several hours of random attempts before I found it..
This is a different solution for the same message, although, in this case it will fail from any location.
Trying to publish a package version previous to the last one published on the feed will return the 403 Forbidden error to, even if it's not a permissions issue.
Updating the package version to one increment after the current version will solve the problem.
I am fairly new to React and am trying to run an example to get started with understanding how Twilio interfaces with React/Node. I am currently using the repo https://github.com/twilio/twilio-video.js, and am trying to run the test > framework > twilio-video-react, but when I npm install then npm start, the server starts, but throws the error:
Failed to compile
./src/App.js
Module not found: Can't resolve 'twilio-video'
I did `npm install twilio-video`, but still throwing error. What am I missing here? Can anyone else get this example started? I want a base example with Twilio Video working with React so I can learn from there, any other resources would help, thanks!
I tried these two examples as well, but they are outdated:
https://www.twilio.com/blog/2018/03/video-chat-react.html
https://www.twilio.com/blog/2016/03/building-a-react-powered-video-chat.html
Okay, got an example up and running with a little fudging.
I followed this example: https://www.twilio.com/blog/2018/03/video-chat-react.html
But there were a few old libraries that were causing errors.
Posted a working version on my Github linked here.
I'm trying to set up msnodesql (formerly node-sqlserver) with my azure hosted site and am running into some issues.
Essentially I'm getting a deployment failed within Azure. I believe it is due to the fact NPM is trying to install msnodesql on the server but will fail because it would need "node-gyp", Python and C++ 2010 installed (which is not present on the azure side). Here is the error message I'm seeing
npm ERR! msnodesql#0.2.0 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the msnodesql#0.2.0 install script.
npm ERR! This is most likely a problem with the msnodesql package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls msnodesql
npm ERR! There is likely additional logging output above.
I've been hacking at this error for a while now and nothing seems to fix it. The best answer I've gotten is to manually include the msnodesql within node_modules (as specified by http://geekswithblogs.net/shaunxu/archive/2012/11/16/install-npm-packages-automatically-for-node.js-on-windows-azure-web.aspx ). I feel like that should fix it but alas it does not. I also tried compiling it against the local x86 node and also just using a prebuilt x86 one (suggested by http://geekswithblogs.net/shaunxu/archive/2012/09/18/node.js-adventure---when-node.js-meets-windows-azure.aspx ).
Any other suggestions would be appreciated here.
Also worth noting is it's working in my local environment just fine and can grab data in from the SQL Azure DB I created (once i've whitelisted my IP) using msnodesql running within webmatrix but hitting Azure SQL DB.
I originally had an issue with the DB and the Website in Azure being on different regions, but I corrected that.
As Glenn Block mentioned, the problem stems from Azure tyring to build the native module when you deploy. This can happen for a few reasons, maybe you didn't upload the binary, maybe it's the wrong binary, or maybe the deployment directory got screwed up.
The Azure server wants the 32 bit driver for Node .6.
What I had to do was FTP into my azure server and delete everything in /site/wwwroot/ except for web.config. You can probably get away with just deleting node_modules, but because the behavior was unexpected I wanted to clean out everything.
Then I went into my Node project directory on my local machine, and went into the node_module/msnodesql directory and deleted everything but package.json and lib directory. In the lib directory, I created separate directories for the binary for my dev machine(64 bit .8) and azure, called 64 and 32 respectively.
I then modified, sqlserver.native.js as follows
try {
module.exports = require('./32/sqlserver.node'); //Azure version
}
catch (e) {
try {
module.exports = require('./64/sqlserver.node'); //My local machine
}
catch (e) {
try {
module.exports = require('../build/Release/sqlserver.node');
}
catch (e) {
console.error('Native sqlserver module not found. Did you remember to run node-gyp configure build?');
throw e;
}
}
}
The big point to make here is that, we try to load all available versions to accommodate for every possibility of deployment I might have, but give priority to the Azure server. On my local dev machine, we failed to load the node from /32 since it's the wrong format, and we fall back to /64.
I bet if I put a little bit of effort into this, I could easily trim what gets deleted down to the bare minimum, but after wasting hours upon hours resolving this, I had enough.
The reason this is failing is because it is trying to build the native module when you deploy. We don't support building native modules in Windows Azure Websites. You can however deploy the binary and then it will work but you would need to not have it in your package.json. Follow this post for more details: http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx