i wanted to run sqlite code in vs code but it shows sqlite is not recognised as an internal or external command - sqlite

C:\Users\acer\djnago>npm install sqlite
added 1 package, and audited 124 packages in 13s
3 packages are looking for funding
run npm fund for details
3 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit for details.
C:\Users\acer\djnago>sqlite flights.sql
'sqlite' is not recognized as an internal or external command,
operable program or batch file.

npm only installs the required libraries for Node.js. You need to install the SQLite tools for Windows from the official website.

Related

Meteor 1.7 bundler is broken

I am trying to deploy an app that has been upgraded to meteor 1.7 using the setup for passenger outlined at puhsionpasserger.com, however when I try and access the app I get an error in the console of
Error: The core-js npm package could not be found in your node_modules directory. Please run the following command to install it: meteor npm install --save core-js
Being shown on the web page (although the favercon is correct so its trying).
The app runs fine locally (as in on the dev machine).
Give its deployed, meteor doesn't exist on the machine.
I tried npm install --save core.js and it reported one package installed, but still no joy on the app front.
I'm not sure where to go from here. Any thoughts?
Edit:
I just tried building the app without the --server-only flag with no change. Deployed the app the way I do with the v1.3 instances of the app and no change.
One thing that I did get when running npm intall from the /programs/server directory was
Binary is fine; exiting
npm WARN lifecycle meteor-dev-bundle#~install: cannot run in wd %s %s (wd=%s) meteor-dev-bundle# node npm-rebuild.js /opt/bundle/programs/server
added 131 packages in 13.857s
I'm not sure if the warning means anything in particular.

Atom on Raspbian?

Very nooby question, but I'm trying to install Atom text editor on Raspbian Stretch. Is it possible? I've heard because it runs on Electron, it's quite slow for Raspbian. I keep getting an error saying:
E: Unable to locate package atom
I'm following the official instructions for Debian. How can I fix this?
As of today you can't install the official package provided for Debian for its mismatching the hardware platform. Provided binary is for running on x86 hardware, but RPi doesn't come with an Intel/AMD processor, but ARM. So, you most probably need to build it from source yourself.
Primer
So, if you really want to build this from source, you should be aware of the waste of disk space caused by the IMHO poorly implemented build tool which is downloading tons of deps and copying and transpiling code around so you'll end up with 2GB+ of files with 80% accounting to dependencies, only. Since my RPi works with 8GB smartcard, only, I couldn't ever meet the need for disk space even though I was bleeding out Linux by manually removing docs, manpages, locales, ton's of outdated and mostly unused apps etc. The build also requires a whole build tooling chain, tons of dev packages for libraries, so there is a limit to milk the system ... 8GB disk drive simply isn't enough for this.
Eventually I tried moving all the files to a USB pen drive. But that drive must be formatted using a filesystem capable of symlinking. So you can't use vfat or FAT32. I didn't succeed to get a 16GB stick formatted with either version of extfs. The mkfs always ended up in a deadlock on trying to write its superblocks. Astonishingly, I couldn't even kill the mkfs with -KILL, but unplugging the drive did help in that case.
So, as a conclusion: here is a short list of steps I passed in expectation to get this working, but in the end I didn't finish due to the memory issues above. And frankly, I stopped caring ... I'd rather work with nano/vi in a terminal than using this ridiculous lego-like built software. I guess, atom is today's version of emacs with regards to the latter's acronym. Maybe you succeed with this, but I won't ...
Build from Source
Inspired by https://discuss.atom.io/t/atom-on-the-raspberry-pi/33332
Install toolchain for building native stuff
sudo apt-get install build-essential git libgnome-keyring-dev fakeroot gconf2 gconf-service libgtk2.0-0 libudev1 libgcrypt20 python rpm libsecret-1-dev xorg-dev
This set of tools was sufficient to build core files without error. Since I didn't start with a fresh installation of Raspbian there might have been some tool I have been using before, so maybe in your case there are more tools to be installed here. Look out for error messages in early stage of building and try to see if some library or header file isn't found. This mostly indicates lack of some package with name ending in -dev to be installed, too. Start by searching for the package using apt search <name-of-mentioned-library> and look for a package combining the missing library's name with suffix -dev. Then install it the usual way by invoking sudo apt-get install <package-name>.
Install up-to-date nodejs
Raspbian Stretch comes with support for NodeJS 8.11 which is basically okay. Install it and its package manager npm using this command:
sudo apt-get install node-js npm
Check installed versions with
node -v
npm -v
This should display 8.x.x on behalf of NodeJs. Use n afterwards if you want to step up:
sudo npm i -g n
sudo n lts
This will switch NodeJS to latest LTS release, which is 10.x as of now. Upgrading NodeJS is optional, but feel advised to always use latest version of npm:
sudo npm i -g npm
Check if upgrades succeeded:
node -v
npm -v
Adjust configuration of npm and install some essential dep:
sudo npm config set -g python /usr/bin/python2
sudo npm i -g node-gyp
Build Atom
Get the source. One option is to pull latest code from its repository:
git clone https://github.com/atom/atom.git
This is creating subfolder atom containing all source files. You might want to download sources of a recent release instead. But this tutorial was made with the sources fetched from Github. So make sure there is subfolder called atom containing sources similar to the ones fetched above.
It's time to start the beast:
cd atom
./script/build
This process will take a while. And it is the culprit that never finished on success in my case due to eating up all disk space over and over again.
Whenever the script fails on error, try to analyze the error, find the cause, fix it, then start the script by repeating the last command above again. If you don't remove any file in subfolder atom in between, the build script keeps passing steps of building atom it has passed successfully before.
Install atom
According to the original tutorial linked before the script should finish on success eventually. Then it's time to install with:
./script/grunt install
I guess this is causing atom to be available as a command from CLI. So, try it out. If everything looks fine you are finally ready to remove the waste of files in subfolder atom.
Feel free to report if this was working in your case.
From what I recall Atom runs 64-bit architecture; need the latest raspberry Pi.
run the following
wget https://atom.io/download/deb && dpkg -i deb

how to solve "Failed at the fibers#2.0.0 install script' error while deploying the meteor app?

I know how to package and then deploy meteor application. But recently for one project i'm stuck at an error which i couldn't resolve.
Steps I followed for package and deploy of my meteor app:
1. meteor build package
2. cd package
3. tar -xf inventoryTool.tar.gz
4. cd bundle/programs/server
5. npm install
6. cd ../..
7. PORT=<port> MONGO_URL=mongodb://127.0.0.1:27017/dbName ROOT_URL=http://<ip> node main.js
Here is the log for the error when i run the npm install(STEP 5) command.
Is there anything missing in my execution?. I'm not using the fibers package anywhere in my project. Does anyone have solution to this problem? Thanks in advance.
Why this happens (a lot)?
Your local version of node is v8.9.4. When using the build command, you will export your application and build the code against this exact node version. Your server environment will require this exact version, too.
An excerpt from the custom deployment section of the guide:
Depending on the version of Meteor you are using, you should install
the proper version of node using the appropriate installation process
for your platform. To find out which version of node you should use,
run meteor node -v in the development environment, or check the
.node_version.txt file within the bundle generated by meteor build.
Even if you don't use fibers explicitly it will be required to run your Meteor app on the server correctly.
So what to do?
In order to solve this, you need to
a) ensure that your local version of node exactly matches the version on the server
b) ensure that you build against the server's architecture (see build command)
To install a) the very specific node version on your server you have two options:
Option I. Use n, as described here. However this works only if your server environment uses node and not nodejs (which depends on how you installed nodejs on the server).
II. To install a specific nodejs version from the repositories, you may do the following:
$ cd /tmp
$ wget https://deb.nodesource.com/node_8.x/pool/main/n/nodejs/nodejs_8.9.4-1nodesource1_amd64.deb
$ apt install nodejs_8.9.4-1nodesource1_amd64.deb
If you are not sure, which of both are installed on your server, check node -v and nodejs -v. One of both will return a version. If your npm install still fails, check the error output and if it involves either node or nodejs and install the desired distribution using the options above.
To build b) against the architecture on your server, you should use the --architecture flag in your build command.

%1 is not a valid Win32 application.. Sqlite3 in Electron app

I’m trying to get sqlite3 to work in an electron app running on Windows7 and 10. Running the following command, I was able to create electron-v1.7-win32-x64\node_sqlite3.node
cd node_modules/sqlite3 && sudo npm install nan
&& sudo npm run prepublish && sudo node-gyp configure --module_name=node_sqlite3 --module_path=…/lib/binding/electron-v1.7-win32-x64
&& node-gyp rebuild --target=1.6.11 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell
--module_name=node_sqlite3 --module_path=…/lib/binding/electron-v1.7-win32-x64
However, I get Uncaught Error: %1 is not a valid Win32 application. \\?\c:\folder\ppt_win32-x64\resources\app\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64\node_sqlite3.node.
My node version is v7.4.0. Electron v1.6.11.
I was trying to compile for windows from mi Mac and I had that problem too, but after some readings I figured out how to proceed, and after all I can say that I got it. Yesterday I spent all day setting up a windows virtual machine in my (other) Linux laptop (I used my linux laptop just because my mac was exhausted in storage...). I was having too a problem with the preloadScript from electron main process in windows, Cant found the script, it was solved too.
Anyway, I think the library node printer from #tojocky is well maintained, in other hand in the electron-builder documentation they say that you should compile in native for natural reasons. Once you will have it, you'll see that it's a cleaner and pragmatic solution ...
This was my entire process, I hope it helps to someone having the same issue:
Get VirtualBox (or Parallels but is not free)
Get iso for W10
Create a VM with this W10 iso, and you should give to this VM some storage (because some dependency that you'll need to compile), I have assigned 60gb to this VM
Once I had that VM running, I just installed in that machine Visual Studio 2017 (with their build-tools included, it's necessary)
And then, I used CMD to make the rest
Install NodeJS (and NPM, but it comes with)
Install node-gyp globally
Install Python 2.7
Clone your project from git (in my case)
npm i (in your project), you should have as npm dependency in your package.json the module electron-builder of course. (here I had some troubles because when node-gyp tried to rebuild printer to generate the binary for windows it was failing, this was because it was imposible to find the python executable, so if you face this problem you should add it like:npm config set python "c:\Python27\python.exe" in my case )
Then try again npm i and Voila!
If you still having error you can rebuild the native dependency as well, run:
node-gyp rebuild --target=YOUR_ELECTRON_TARGET[eg: 1.8.4] --arch=YOUR_ARCH_TARGET[eg: x64 | ia32] --dist-url=https://atom.io/download/atom-shell
After all, you should make the build using electron-builder, in my case my npm script command was build --win --x64 but you can use the --ia32 flag as well for 32bits

publish-for-arch issues in meteor

I've created package and published it, It is just a simple wrapper of "phantom"
I deployed it using
sudo meteor publih --create
then added it to my app
$> meteor show sasi513:phantom#1.0.0
Version 1.0.0 : phantom node Package wrapper
Architectures: os.linux.x86_32+web.browser+web.cordova
Maintained by sasi513.
EDIT
Then when I try to deploy it meteor deploy xxx.meteor.com
Errors prevented deploying:
While building the application:
error: Unable to download package builds for this architecture.
and I tried to publish-for-arch
sudo meteor publish-for-arch sasi513:phantom#1.0.0
sasi513:phantom: updating npm dependencies -- phantom...
Bundling build...
Creating package build...
Uploading build...
Publishing package build...
Error from package server
: Cannot override existing build [403]
What is wrong here?Anyone has idea about this
The documentation says:
You need to run publish-for-arch from a different architecture to
upload a different build.
Are you running the command on a different architecture? Or the same machine? Because running the command on the same machine wont work.[1] Based on your description, it sounds like you didn't try it from the other architecture you want to support.
[1] http://docs.meteor.com/#meteorpublishforarch

Resources