Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

When i was working in a new nodejs project,I tried to create it from scratch.I used express js for the project.In order to do it properly i used Express application generator by excuting the command


npx express-generator


then i run the nodejs application by executing the below command on the VS Code terminal 



 SET DEBUG=study:* & npm start


when i run the above command,i got the error as shown below


At line:1 char:19

+ SET DEBUG=study:* & npm start

+                   ~

The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it  

as part of a string.

    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException

    + FullyQualifiedErrorId : AmpersandNotAllowed




So in order to fix the error -The ampersand (&) character is not allowed. The & operator is reserved for future use;wrap an ampersand in double quotation marks ("&") to pass it  as part of a string.


I executed the same command on command prompt instead of VS Code terminal.It worked without any error 






Now my node js application run fine 



Thank you